Stylesheets variant type. Optional. An array of single values or values, used to specify the XSL conversion (XSLT) style table processing instructions to be applied.
Loadoption variant type, conversion. Specifies how to open an XML data file in Excel. Can be one of the xlxmlloadoption constants.
Xlxmlloadoption can be one of the following xlxmlloadoption constants:
Xlxmlloadimporttolist puts the content of the XML data file in the XML list.
Xlxmlloadmapxml shows the XML data file architecture in the "XML structure" task pane.
Xlxmlloadopenxml open the XML data file. The file content is expanded.
Xlxmlloadpromptuser prompts you to select the file opening method.
Example
The following code opens the XML data file "MERs. xml" and displays the content of this file in the XML list.
Sub UseOpenXML()
Application.Workbooks.OpenXML _
Filename:="customers.xml", _
LoadOption:=xlXmlLoadImportToList
End Sub
The opendatabase method syntax is as follows:
Workbooks. opendatabase (filename, commandtext, commandtype, backgroundquery, importdataas)
Filename string type, required. The connection string.
Commandtext variant type. Optional. Query command text.
Commandtype variant type. Optional. Query command type. The following command types are available: Default, SQL, and table.
(Optional) Type of backgroundquery variant. The background of the query.
Optional. importdataas variant type. Determine the Query format.
Example
In this example, the "northwind. mdb" file is opened in Excel.
Sub OpenDatabase()
Workbooks.OpenDatabase FileName:="C:northwind.mdb"
End Sub