Compartir a través de


Workbooks.OpenXML Method

Opens an XML data file. Returns a Workbook object.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function OpenXML ( _
    Filename As String, _
    Stylesheets As Object, _
    LoadOption As Object _
) As Workbook
'Usage
Dim instance As Workbooks
Dim Filename As String
Dim Stylesheets As Object
Dim LoadOption As Object
Dim returnValue As Workbook

returnValue = instance.OpenXML(Filename, _
    Stylesheets, LoadOption)
Workbook OpenXML(
    string Filename,
    Object Stylesheets,
    Object LoadOption
)

Parameters

  • Filename
    Type: System.String

    Required String. The name of the file to open.

  • Stylesheets
    Type: System.Object

    Optional Object. Either a single value or an array of values that specify which XSL Transformation (XSLT) style sheet processing instructions to apply.

  • LoadOption
    Type: System.Object

    Optional Object. Specifies how Excel opens the XML data file. Can be one of these XlXmlLoadOption constants:

    xlXmlLoadImportToList Places the contents of the XML data file in an XML list.

    xlXmlLoadMapXml Displays the schema of the XML data file in the XML Structure task pane.

    xlXmlLoadOpenXml Opens the XML data file. The contents of the file will be flattened.

    xlXmlLoadPromptUser Prompts the user to choose how to open the file.

Return Value

Type: Microsoft.Office.Interop.Excel.Workbook

Remarks

XML features, except for saving files in the XML Spreadsheet format, are available only in Microsoft Office Professional Edition 2003 and Microsoft Office Excel 2003.

See Also

Reference

Workbooks Interface

Workbooks Members

Microsoft.Office.Interop.Excel Namespace