From f546f7c7d1c8b904e5ecb5aa41d5f585c2d167e0 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Thu, 11 Oct 2018 14:24:59 -0400 Subject: [PATCH] don't quote cells that look like json objects themselves --- TheBigOne.cls | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/TheBigOne.cls b/TheBigOne.cls index a6b6884..eb2f194 100644 --- a/TheBigOne.cls +++ b/TheBigOne.cls @@ -2073,7 +2073,12 @@ Public Function json_from_table(ByRef tbl() As Variant, ByRef array_label As Str If IsNumeric(tbl(r, c)) And Mid(tbl(r, c), 1, 1) <> 0 Then json = json & Chr(34) & tbl(1, c) & Chr(34) & ":" & tbl(r, c) Else - json = json & Chr(34) & tbl(1, c) & Chr(34) & ":" & Chr(34) & tbl(r, c) & Chr(34) + 'test if item is a json object + If Mid(tbl(r, c), 1, 1) = "{" Or Mid(tbl(r, c), 1, 1) = "[" Then + json = json & """" & tbl(1, c) & """" & ":" & tbl(r, c) + Else + json = json & Chr(34) & tbl(1, c) & Chr(34) & ":" & Chr(34) & tbl(r, c) & Chr(34) + End If End If End If Next c