Skip to content

Latest commit

 

History

History
52 lines (34 loc) · 1.34 KB

Excel.Workbooks.OpenXML.md

File metadata and controls

52 lines (34 loc) · 1.34 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Workbooks.OpenXML method (Excel)
vbaxl10.chm203088
vbaxl10.chm203088
Excel.Workbooks.OpenXML
c16a7842-19e9-6731-146e-038322c248ba
05/18/2019
medium

Workbooks.OpenXML method (Excel)

Opens an XML data file. Returns a Workbook object.

Syntax

expression.OpenXML (FileName, Stylesheets, LoadOption)

expression A variable that represents a Workbooks object.

Parameters

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.

Return value

Workbook

Example

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]