supriya2309
10-18-2020, 11:17 PM
Public filepath As String
Public Sub ConvertJSON()
UserForm1.Show
MsgBox (filepath)
ActiveWorkbook.Queries.Add Name:="IMportJSON", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Source = Json.Document(File.Contents(""" & filepath & """ ))," & Chr(13) & "" & Chr(10) & " #""Converted to Table"" = Record.ToTable(Source)" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Converted to Table"""
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=0, Source:= _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=ImportJSON;Extended Properties=""""" _
I guys very new to coding got an error 438 on the line which is in bold, please do help
Thanks and Regards,
Supriya
Public Sub ConvertJSON()
UserForm1.Show
MsgBox (filepath)
ActiveWorkbook.Queries.Add Name:="IMportJSON", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Source = Json.Document(File.Contents(""" & filepath & """ ))," & Chr(13) & "" & Chr(10) & " #""Converted to Table"" = Record.ToTable(Source)" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Converted to Table"""
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=0, Source:= _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=ImportJSON;Extended Properties=""""" _
I guys very new to coding got an error 438 on the line which is in bold, please do help
Thanks and Regards,
Supriya