XmlMappedRange.Change Event
Occurs when something changes in the XmlMappedRange control.
Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
Syntax
'Declaration
Event Change As DocEvents_ChangeEventHandler
event DocEvents_ChangeEventHandler Change
Remarks
This event is raised if the XmlMappedRange control is changed by either a programmatic modification or user interaction. This event does not occur when the XmlMappedRange control changes during a recalculation.
Examples
The following code demonstrates a handler for the Change event that displays the address of the XmlMappedRange that changed. This code example assumes that the current worksheet contains an XmlMappedRange named CustomerLastNameCell.
Sub CustomerLastNameCell_Change(ByVal Target As Excel.Range) _
Handles CustomerLastNameCell.Change
Dim changedRange As String = Target.Address( _
ReferenceStyle:=Excel.XlReferenceStyle.xlA1)
MsgBox("The value of " & Me.Name & ":" & changedRange & _
" has been changed.")
End Sub
private void XmlMappedRange_Change()
{
this.CustomerLastNameCell.Change +=
new Excel.DocEvents_ChangeEventHandler(
CustomerLastNameCell_Change);
}
void CustomerLastNameCell_Change(Excel.Range Target)
{
string changedRange = Target.get_Address(missing, missing,
Excel.XlReferenceStyle.xlA1, missing, missing);
MessageBox.Show("The value of " + this.Name + ":" +
changedRange + " has been changed.");
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.