Open XML File in Excel

Here are the primitive commands to open an XML file in Microsoft Excel.

Sub Open_XMLFile()
Dim OXML As Workbook
Set OXML = Workbooks.OpenXML(“c:\sample.xml”)
End Sub

Sub Open_XML_File_As_List()
Dim OXML As Workbook
Set OXML = Workbooks.OpenXML(Filename:=”c:\sample.xml”, LoadOption:=XlXmlLoadOption.xlXmlLoadImportToList)
End Sub

This option will work for Excel 2003 and above

Explore comprehensive Excel VBA Macro Programming here and, learn to automate your routine Excel Reports, Processes and Tasks.

Happy Excelling
Team Excelgoodies

Leave a Reply

Your email address will not be published. Required fields are marked *