Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hmmm.... your code works fine for me. What do you mean when you say it doesn't
work? Do not see the message box? If so, are you sure that events are enabled? You could add the line Application.EnableEvents = True to the Workbook_Open event code. But have you considered protecting the workbook's structure? That disallows adding sheets (and possibly some other things). Check it out in Help. On Mon, 21 Feb 2005 13:01:04 -0800, "Paige" wrote: I am trying to prevent a user from adding worksheets to a particular workbook. The code I am using (see below) doesn't work; I don't get any error messages. Any suggesions on what I am doing wrong? Private Sub Workbook_NewSheet(ByVal Sh As Object) Application.DisplayAlerts = False MsgBox "New sheets may not be added. " & _ "Sheet will be deleted" Sh.Delete Application.DisplayAlerts = True End Sub Thanks...Paige |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Prevent formula from changing when adding in cells | Excel Discussion (Misc queries) | |||
code to prevent users from adding new worksheets | Excel Worksheet Functions | |||
Prevent adding rows | Excel Programming | |||
How to prevent anyone from viewing the code | Excel Programming | |||
Adding code to worksheets | Excel Programming |