다음을 통해 공유


XmlMappedRange.Change Event

Definition

Occurs when something changes in the XmlMappedRange control.

public:
 event Microsoft::Office::Interop::Excel::DocEvents_ChangeEventHandler ^ Change;
event Microsoft.Office.Interop.Excel.DocEvents_ChangeEventHandler Change;
member this.Change : Microsoft.Office.Interop.Excel.DocEvents_ChangeEventHandler 
Event Change As DocEvents_ChangeEventHandler 

Event Type

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.

private void XmlMappedRange_Change()
{
    this.CustomerLastNameCell.Change += 
        new Excel.DocEvents_ChangeEventHandler(
        CustomerLastNameCell_Change);
}

void CustomerLastNameCell_Change(Excel.Range Target)
{
    string changedRange = Target.get_Address(Excel.XlReferenceStyle.xlA1);

    MessageBox.Show("The value of " + this.Name + ":" +
        changedRange + " has been changed.");
}
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

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.

Applies to