LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Code to Prevent Adding Worksheets

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent formula from changing when adding in cells Rhett C[_2_] Excel Discussion (Misc queries) 2 October 2nd 09 09:35 PM
code to prevent users from adding new worksheets jat Excel Worksheet Functions 2 March 18th 09 08:24 PM
Prevent adding rows Rene[_3_] Excel Programming 1 May 7th 04 06:07 AM
How to prevent anyone from viewing the code Shilps Excel Programming 3 April 30th 04 05:16 AM
Adding code to worksheets mgs[_2_] Excel Programming 0 January 4th 04 11:33 PM


All times are GMT +1. The time now is 07:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"