Hi,
I am trying to import an XML file in Excel but the problem I face is that the numbers are getting truncated.
For ex: 008 in XML is getting imported as 8
and 73.33333333333333 is getting truncated as 73.33333
I want data as is from XML to be in Excel. Any help is highly appreciated.
I tried this macro: but the data is getting truncated.
I picked this from another forum:'
Sub ImportXMLtoList()
Dim strTargetFile As String
Dim wb as Workbook
Application.Screenupdating = False
Application.DisplayAlerts = False
strTargetFile = "C:\example.xml"
Set wb = Workbooks.OpenXML(Filename:=strTargetFile, LoadOption:=xlXmlLoadImportToList)
Application.DisplayAlerts = True
wb.Sheets(1).UsedRange.Copy ThisWorkbook.Sheets("Sheet2").Range("A1")
wb.Close False
Application.Screenupdating = True
End Sub
Thanks
Bookmarks