This documentation is archived and is not being maintained.

Undo Method

Office 2003

For the ChartSpace and Spreadsheet objects, undoes the last single action or the last macro block surrounded by BeginUndo and EndUndo method calls.

For the DataPage object, restores the data access page to the condition before the recordset was edited if the edits have not been saved.


expression    An expression that returns a ChartSpace, DataPage, or Spreadsheet object.


This example undoes the last action or displays a message box if this action cannot be undone.

If Spreadsheet1.CanUndo Then
    MsgBox "can't undo last action"
End If