BindingData Property

Microsoft Office Web Components Visual Basic

BindingData Property

Returns or sets the configuration data for a given XmlDataBinding object. Read/write String.

expression .BindingData

expression    Required. An expression that returns an XmlDataBinding object.

Remarks

The XmlDataBinding object contains configuration data in the form of XML. The format of the configuration data must follow the Spreadsheet component XML schema as defined in the XML spreadsheet file. The BindingId is a new XML fragment that must be the same as the current value, or a run-time error will be generated. The BindingID is the ID attribute of an XmlDataBinding object and must be unique across all worksheets in a workbook.

Example

The following example first gets the number of XMLDataBinding objects in the XmlDataBindings collection of the Workbook object. Then it iterates through each of the XMLDataBinding objects to get the BindingData property.

    Sub ViewBindings()

    Dim strXml
    Dim intBinding
    Dim intCounter

    ' Get the number of XmlDataBinding objects in the XmlDataBindings collection.    
    intBinding = Spreadsheet1.ActiveWorkbook.XmlDataBindings.Count
    
    ' Display a message box.
   	MsgBox ("There are " & intBinding & " XmlDataBinding objects in the collection")
	    
    ' Loop through each XmlDataBinding object in the collection. 
    intCounter =1
    For intCounter = 1 to intBinding

		    ' Get the configuration data for a given XmlDataBinding object from a XmlDataBindings collection.
			     strXml = Spreadsheet1.ActiveWorkbook.XmlDataBindings.Item(intCounter).BindingData
			     MsgBox ("Binding item #"  &  intCounter  & " returned XML:" & chr(10) & strXml)
			
		  Next

End Sub