VBA-tools / VBA-JSON

JSON conversion and parsing for VBA
MIT License
1.76k stars 568 forks source link

Vba Runtime Error 14 Out Of String Space 2 #209

Open wgaskill1 opened 3 years ago

wgaskill1 commented 3 years ago

I'm having the error with the string you identified " JsonString = VBA.Replace(VBA.Replace(VBA.Replace(JsonString, VBA.vbCr, ""), VBA.vbLf, ""), VBA.vbTab, "")". Have you identified a work-around? I've tried splitting up the string and doing this in pieces, but it still errors with a Jsonstring greater than 50,000,000 lines. (I don't have a capability to decrease the size - it's in a production system).

houghtonap commented 3 years ago

Honestly, you are using the wrong tool for the job. VBA-JSON creates objects in memory to represent the JSON. Those object use memory and you have a limited amount of memory (RAM) in your computer. Trying to process 50 million lines of JSON with VBA-JSON is not going to work, unless you have several gigabytes of available physical RAM in your computer.

My suggestion is to use a SQL database that understands JSON, most now a days, or a NO-SQL database like Mongo which understands JSON and process your data that way.