Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have an XML file that i have no idea how to load in properly, could someone possibly help please?
i have attached a sample file (saved as xls) and i need to load in the data as it is (like a standard xls, with the columns being loaded in a field names)
any help would be great.
Thanks
hi alfredo,
Just a suggestion, reading from xml can sometimes not be so easy. Thats why i always execute a vbs script to convert the xml to xls and then read from xls.
---------------------------------------------------
VBS
--------------------------------------------------
Vbscript to convert to xls :
Dim xlApp, xlWkb, SourceFolder,TargetFolder,file
Set xlApp = CreateObject("excel.application")
Set fs = CreateObject("Scripting.FileSystemObject")
file ="Sample.xml"
Const xlNormal=1
SourceFolder="C:\Users\mjayachandran\Desktop"
TargetFolder="C:\Users\mjayachandran\Desktop"
xlApp.Visible = false
Set xlWkb = xlApp.Workbooks.Open(SourceFolder & "\" & file)
BaseName= fs.getbasename(SourceFolder & "\" & file)
FullTargetPath=TargetFolder & "\" & BaseName & ".xls"
xlWkb.SaveAs FullTargetPath, xlNormal
xlWkb.close
fs.DeleteFile("C:\Users\mjayachandran\Desktop\Sample.xml")
Set xlWkb = Nothing
Set xlApp = Nothing
Set fs = Nothing
------------------------------------------------------------------------------
after you read the xls file successfully. you can again execute a command to delete the generated xls file.