Name

workbook.RejectAllChanges([When], [Who], [Where])

Synopsis

For shared workbooks, rolls back changes made by others. RejectAllChanges can remove changes that are in the workbook’s change history that have not yet been committed by an AcceptAllChanges method.

Argument

Settings

When

A string indicating the time after which to reject changes.

Who

A string indicating the user from which to reject changes. Can be "Everyone", "Everyone but Me", or the name of one of the users of the shared workbook.

Where

A string indicating a range of cells for which to reject changes.

For example, the following code rejects all of the changes made within the last 24 hours:

If ThisWorkbook.MultiUserEditing Then
    ThisWorkbook.RejectAllChanges CStr(Now - 1)
End If

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.