convert variant array to string to avoid a bunch of typing
This commit is contained in:
parent
46f834a985
commit
953bd3548f
17
handler.bas
17
handler.bas
@ -83,6 +83,7 @@ Sub pg_main_workset()
|
|||||||
Dim j As Long
|
Dim j As Long
|
||||||
Dim doc As String
|
Dim doc As String
|
||||||
Dim res() As Variant
|
Dim res() As Variant
|
||||||
|
Dim str() As String
|
||||||
|
|
||||||
doc = "{""quota_rep"":""13025 - JAMES REGER""}"
|
doc = "{""quota_rep"":""13025 - JAMES REGER""}"
|
||||||
|
|
||||||
@ -98,7 +99,7 @@ Sub pg_main_workset()
|
|||||||
Set json = JsonConverter.ParseJson(wr)
|
Set json = JsonConverter.ParseJson(wr)
|
||||||
ReDim res(json("x").Count, 32)
|
ReDim res(json("x").Count, 32)
|
||||||
|
|
||||||
For i = 0 To UBound(res, 1)
|
For i = 0 To UBound(res, 1) - 1
|
||||||
res(i, 0) = json("x")(i + 1)("bill_cust_descr")
|
res(i, 0) = json("x")(i + 1)("bill_cust_descr")
|
||||||
res(i, 1) = json("x")(i + 1)("billto_group")
|
res(i, 1) = json("x")(i + 1)("billto_group")
|
||||||
res(i, 2) = json("x")(i + 1)("ship_cust_descr")
|
res(i, 2) = json("x")(i + 1)("ship_cust_descr")
|
||||||
@ -136,6 +137,18 @@ Sub pg_main_workset()
|
|||||||
|
|
||||||
Set json = Nothing
|
Set json = Nothing
|
||||||
|
|
||||||
|
ReDim str(UBound(res, 1), UBound(res, 2))
|
||||||
|
|
||||||
|
For i = 0 To UBound(res, 1)
|
||||||
|
For j = 0 To UBound(res, 2)
|
||||||
|
If IsNull(res(i, j)) Then
|
||||||
|
str(i, j) = ""
|
||||||
|
Else
|
||||||
|
str(i, j) = res(i, j)
|
||||||
|
End If
|
||||||
|
Next j
|
||||||
|
Next i
|
||||||
|
|
||||||
|
Call x.SHTp_Dump(str, "Sheet1", 1, 1, True, False)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
Loading…
Reference in New Issue
Block a user