I need convert data from excel table with about twenty columns and a lot of rows into json. I don't found a short example of code for this purpose in vba. I found this one https://github.com/VBA-tools/VBA-JSON/blob/master/JsonConverter.bas , but it is very large. May be it is a shorter example?
I'd go with modified version of this one: http://www.excelvbamacros.in/2015/01/export-range-in-jason-format.html
if you want to write it to file there's a code:
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Dim Fileout As Object
Set Fileout = fso.CreateTextFile("C:\some_dir\mydata.json", True, True)
Fileout.Write jsonStringFromConvertFunction
Fileout.Close
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With