PC Review


Reply
Thread Tools Rate Thread

Code so that worksheets cannot be added to workbook

 
 
D
Guest
Posts: n/a
 
      2nd Mar 2010
Does anyone know if it is possible to have a code in the background that will
not let users add worksheets to a workbook? If so, how would this be done?
 
Reply With Quote
 
 
 
 
FSt1
Guest
Posts: n/a
 
      2nd Mar 2010
hi
personally i don't know how you can prevent users from adding new sheets but
you can delete them as fast as they are added.

Private Sub Workbook_NewSheet(ByVal Sh As Object)
MsgBox "new sheet are prohibited."
Application.DisplayAlerts = False
ActiveSheet.Delete
Application.DisplayAlerts = True
End Sub

regards
FSt1

"D" wrote:

> Does anyone know if it is possible to have a code in the background that will
> not let users add worksheets to a workbook? If so, how would this be done?

 
Reply With Quote
 
D
Guest
Posts: n/a
 
      2nd Mar 2010
This is awesome!! Works great. Perfect for those workbooks that users are
having to paste data to that is linked to say another workbook or program.

Thanks!

"FSt1" wrote:

> hi
> personally i don't know how you can prevent users from adding new sheets but
> you can delete them as fast as they are added.
>
> Private Sub Workbook_NewSheet(ByVal Sh As Object)
> MsgBox "new sheet are prohibited."
> Application.DisplayAlerts = False
> ActiveSheet.Delete
> Application.DisplayAlerts = True
> End Sub
>
> regards
> FSt1
>
> "D" wrote:
>
> > Does anyone know if it is possible to have a code in the background that will
> > not let users add worksheets to a workbook? If so, how would this be done?

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      2nd Mar 2010
You could protect the workbook's structure.

But that will prevent new sheets, moving existing sheets, deleting sheets,
renaming sheets...

In xl2003 menus:
tools|protection|protect workbook



D wrote:
>
> Does anyone know if it is possible to have a code in the background that will
> not let users add worksheets to a workbook? If so, how would this be done?


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How many total worksheets can be added to a workbook? Alberto Microsoft Excel Misc 4 23rd Nov 2008 06:34 AM
HELP => VBA Code To Import Worksheets Into A WorkBook tommo_blade Microsoft Excel Programming 7 3rd Jul 2008 07:56 PM
Rename worksheets of workbook - Error code transferxxx@gmail.com Microsoft Excel Programming 1 21st Jul 2007 12:31 AM
macro to execute code on all worksheets in workbook =?Utf-8?B?R3JldHRh?= Microsoft Excel Programming 5 5th Apr 2007 03:44 PM
Can i run VB code when a user changes Worksheets within an Excel Workbook Douglas Microsoft Excel Discussion 1 29th Jan 2005 01:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:25 AM.