I realized that there is also a method to convert that data into a JSON string. The following code would convert a worksheet into JSON, and can be downloaded here.
OptionExplicitPublicSub mainExample()Dim dSet As cDataSet
Set dSet =New cDataSet
With dSet
.populateData Range("data!$a$1"),,,,,,TrueIf.WhereIsNothingThenMsgBox("No data to process")ElseMsgBox.jSonObject
EndIfEndWithEndSub
I am a Google Developer Expert and decided to investigate Google Apps Script in my spare time.
The more I investigated the more content I created so this site is extremely rich. Now, in 2019, a lot of things have disappeared or don’t work anymore due to Google having retired some stuff. I am however leaving things as is and where I came across some deprecated stuff, I have indicated it.
I decided to write a book about it and to also create videos to teach developers who want to learn Google Apps Script. If you find the material contained in this site useful, you can support me by buying my books and or videos.
bruce mcpherson is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Based on a work at http://www.mcpher.com. Permissions beyond the scope of this license may be available at code use guidelines
Here is a write up on creating jSon from Excel (and the visa versa) using this method.
https://ramblings.mcpher.com/Home/excelquirks/json/excel-json-conversion
Bruce