Hi:
I have a shared worksheet that sits on a network. It is entirely password protected so users can open it to review/ print data but not edit. I want to assure that new worksheets can NOT be added to the file so I added the code below to the Workbook_New Sheet module. It produces the message but allows the new worksheets to be added. If the file is closed, those sheets are not saved. However, if the user types something on one of the new sheets, it IS saved. Does anyone know how to prevent the worksheet from even being created? I have used this code before and it worked so not sure where I am going wrong.
Option Explicit
Private Sub Workbook_NewSheet(ByVal Sh As Object)
With Application
.ScreenUpdating = False
.DisplayAlerts = False
ActiveSheet.Delete
MsgBox "Adding new sheet is not permitted"
.DisplayAlerts = True
.ScreenUpdating = True
End With
End Sub
Bookmarks