
Modern Json in VBA - v3.0.0 Released
Released earlier this year, ModernJsonInVBA parses JSON and writes it straight into Excel tables (ListObjects), and converts tables back to JSON roundtrip. It is pure VBA: no Scripting.Dictionary, no COM references, no external libraries. One call turns JSON text to a populated, refreshable table:
Excel_UpsertListObjectFromJsonAtRoot ws, "tOrders", ws.Range("A1"), jsonText, "$"
v3.0.0 split the engine into eleven modules and rewrote the parser and the Excel write path. I benchmarked it across seven payloads that vary in size and shape (flat rows, nested objects, escape-heavy strings, a 200-column wide table, numeric-heavy) and collected the results into a matrix.
Payloads
| Payload | Rows | Cols | Size |
|---|---|---|---|
| flat_10k | 10,000 | 10 | 2.1 MB |
| nested_50k | 50,000 | 9 | 9.2 MB |
| escapes_50k | 50,000 | 6 | 14.8 MB |
| wide_5k_200c | 5,000 | 200 | 16.0 MB |
| flat_100k | 100,000 | 10 | 21.6 MB |
| numbers_200k | 200,000 | 8 | 25.9 MB |
| flat_500k | 500,000 | 10 | 109.5 MB |
Timings (seconds) — rows are pipeline steps, columns are payloads:
| Step | flat_10k | nested_50k | escapes_50k | wide_5k_200c | flat_100k | numbers_200k | flat_500k |
|---|---|---|---|---|---|---|---|
| Read file | 0.0273 | 0.0938 | 0.1523 | 0.1641 | 0.2227 | 0.2695 | 1.1289 |
| Json_Parse (JSON to model) | 0.2695 | 1.5586 | 1.3203 | 2.2344 | 2.3672 | 4.3984 | 11.8789 |
| Json_Stringify (model to JSON) | 0.2695 | 1.6719 | 1.4023 | 1.7266 | 2.5742 | 3.0430 | 12.9492 |
| Upsert create (JSON to ListObject) | 0.3281 | 2.4727 | 2.0625 | 2.8828 | 3.4727 | 4.7383 | 18.2656 |
| Upsert refresh | 0.3789 | 2.7422 | 2.3711 | 3.4844 | 3.9688 | 5.7305 | 20.3828 |
| Export (ListObject to JSON) | 0.1328 | 3.5195 | 0.9609 | 0.8477 | 1.3945 | 1.1484 | 7.1094 |
What the matrix shows:
- 500,000 rows / 110 MB of JSON into a live Excel table in about 18 seconds (Upsert create). That is roughly 27,000 rows/sec, or ~275,000 cells/sec.
- Small payloads are effectively instant: 10,000 rows loads in about a third of a second.
- A raw block write of 5 million cells takes only a few seconds; most of the 18 s is parsing and shaping the JSON.
- Upsert streams JSON straight into a 2D array for a root array (
tableRoot = "$") and does not build an intermediate object model, so it keeps pace with a standalone parse plus a sheet write.
The benchmark machine is a Ryzen 7 9800X3D with 64-bit Excel, each cell is one wall-clock Timer run, and the payloads come from a seeded generator (deterministic). Times are hardware-dependent, so a typical office laptop will be slower. The whole table regenerates from the workbook with one macro (Run_JsonPerfMatrix), so you can produce your own numbers.
The library also does CSV and XML to JSON, JSONPath-style path resolution, schema evolution controls, and formula-preserving refreshes. Determinism is the design goal: stable column order, strict validation, and clear error numbers instead of silent guesses.
Repo (MIT): https://github.com/WilliamSmithEdward/ModernJsonInVBA
https://github.com/WilliamSmithEdward/ModernJsonInVBA/releases/tag/v3.0.0
Feedback is welcome.