Name
workbooks.OpenXML(Filename, [Stylesheets], [LoadOption])
Synopsis
Creates a new workbook and loads an XML file into it. Returns a reference to the new workbook.
|
Argument |
Settings |
|---|---|
|
|
The name of the XML file to load. |
|
|
A number or an array of numbers indicating the XML Style Sheet (XSL) instructions to execute. |
|
|
Determines how the XML file is interpreted or loaded; may be one of the following |
The idea of executing a limited number of XSL processing instructions seems strange and there are no examples of this provided in Help. Excel ignores the argument if there are no processing instructions in the XML file.
Use the LoadOption argument to control how Excel loads the XML. For example, complex XML files are “flattened” by default, which often isn’t what you want. By using the LoadOption
xmlLoadMapXml, you can load the XML as an XML map and allow the user to choose the items to import into the worksheets as lists. The following code imports an XML file as an XML map:
Set wb = Workbooks.OpenXML( _
"http://www.mstrainingkits.com/excel/excelobjects.xml", , _
XlXmlLoadOption.xlXmlLoadMapXml)Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access