Class XmlDataBinding (Excel VBA)

The class XmlDataBinding represents the connection to the source data for an XmlMap object.

Item

To use a XmlDataBinding class variable it first needs to be instantiated, for example

Dim xdb as XmlDataBinding
Set xdb = ActiveWorkbook.XmlMaps(1).DataBinding

XmlDataBinding class variables can be set using the XmlMap.DataBinding procedure.

ClearSettings

Removes the specified data binding.

ActiveWorkbook.XmlMaps(1).DataBinding.ClearSettings

LoadSettings

Initializes the specified data binding with settings from an XML data file or a Data Retrieval Service Connection (.uxdc) file.

LoadSettings (Url)

Url: The path to the XML data file. The path is specified in the Uniform Resource Locator (URL) or universal naming convention (UNC) format.

Dim strUrl As String: strUrl = 
ActiveWorkbook.XmlMaps(1).DataBinding.LoadSettings Url:=strUrl

Refresh

Retrieves XML data by using the current connection settings of the specified XmlDataBinding object.

xlXmlImportElementsTruncated - The contents of the specified XML data file have been truncated because the XML data file is too large for the worksheet, xlXmlImportSuccess - The XML data file was successfully imported, xlXmlImportValidationFailed - The contents of the XML data file do not match the specified schema map.
Dim xxiRefresh As XlXmlImportResult
xxiRefresh = ActiveWorkbook.XmlMaps(1).DataBinding.Refresh()

SourceUrl

Returns a String that represents the path to the XML data file or the web service that provides the source data for the specified data binding.

Dim strSourceUrl As String
strSourceUrl = ActiveWorkbook.XmlMaps(1).DataBinding.SourceUrl