Name

workbook.ExclusiveAccess

Synopsis

For shared workbooks, removes sharing and grants the current user exclusive access to the workbook. The following code removes sharing from a workbook:

If ThisWorkbook.MultiUserEditing Then
    ThisWorkbook.ExclusiveAccess
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.