ExportXML Method

As it applies to the DataSourceControl object.

Saves the current recordset as an XML file.

expression**.ExportXML(eEncoding)**

*expression   * Required. An expression that returns a DataSourceControl object.

DscEncodingEnum

DscEncodingEnum can be one of these DscEncodingEnum constants.
dscUTF16
dscUTF8default

Remarks

Use the XMLLocation property to set whether the data is exported to an XML data island or a separate XML data file. Use the XMLDataTarget property to specify the path or ID to use when exporting the data.

As it applies to the XmlMap object.

Saves the data in the specified schema map to an XML data stream.

expression**.ExportXML(ShowDialogs)**

*expression   * Required. An expression that returns an XmlMap object.

ShowDialogs   Optional Boolean. Specifies whether a dialog box is displayed if the ExportXML method encounters an error that is returned by the Spreadsheet component itself. When *ShowDialogs   * is set to True, a dialog box is displayed if the ExportXML method encounters an error returned by the Spreadsheet component. When ShowDialogs is set to False, dialog boxes for Spreadsheet component errors are not displayed. The default is False.

Note  The ShowDialogs argument does not control whether a dialog box will be displayed for errors external to the Spreadsheet component, such as errors returned by scripting components. To prevent a dialog box from displaying for errors external to the Spreadsheet component, you must trap those errors in your script.

Remarks

If the ExportXml method is called on an XmlMap object while an asynchronous binding is in progress, a run-time error will occur. You can determine if a data binding is asynchronous by using the Async property of the XmlDataBinding object. You can determine whether a binding is in progress by using the BindingInProgress property of the XmlDataBinding object.

Example

As it applies to the DataSourceControl object.

This example exports the current data in the data source control named MSODSC to an XML data file.

Sub ExportData()

   Dim dscConstants

   Set dscConstants = MSODSC.Constants

   ' Set the location of the XML data to a data file.
   MSODSC.XMLLocation = dscConstants.dscXMLDataFile

   ' Set the specific target to export to.
   MSODSC.XMLDataTarget = "Q1 Sales Analysis.xml"

   ' Export the current data.
   MSODSC.ExportXML

End Sub

Applies to | DataSourceControl Object | XmlMap Object

See Also | Export Method | ExportPicture Method