title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
Workbooks.OpenXML method (Excel) |
vbaxl10.chm203088 |
|
|
c16a7842-19e9-6731-146e-038322c248ba |
05/18/2019 |
medium |
Opens an XML data file. Returns a Workbook object.
expression.OpenXML (FileName, Stylesheets, LoadOption)
expression A variable that represents a Workbooks object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
FileName | Required | String | The name of the file to open. |
Stylesheets | Optional | Variant | Either a single value or an array of values that specify which XSL Transformation (XSLT) stylesheet processing instructions to apply. |
LoadOption | Optional | Variant | Specifies how Excel opens the XML data file. Can be one of the XlXmlLoadOption constants. |
Workbook
The following code opens the XML data file Customers.xml and displays the file's contents in an XML list.
Sub UseOpenXML()
Application.Workbooks.OpenXML _
Filename:="Customers.xml", _
LoadOption:=xlXmlLoadImportToList
End Sub
[!includeSupport and feedback]