Travis Banger
Travis Banger

Reputation: 81

Excel AddIn: How to detect/prevent an Excel user from removing a worksheet?

Environment:

I just discovered the SheetBeforeDelete event which is very helpful for my application's requirements.

It seems, however, that all the programmer can expect is to be notified about the impending, inevitable disappearance of a worksheet.

What if we need to programmatically implement a policy whereby the removal of certain worksheet(s) is verboten? Is there a way to instruct Excel "Abort the ongoing operation"?

Upvotes: 0

Views: 295

Answers (1)

Eugene Astafiev
Eugene Astafiev

Reputation: 49445

The best what you can do is to use the Protect method of the Worksheet or Workbook class which allows to protect a worksheet so that it cannot be modified.

Upvotes: 1

Related Questions