View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Code to Prevent Adding Worksheets

Hi Paige

Why don't you protect the workbook


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Paige" wrote in message ...
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