Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
D D is offline
external usenet poster
 
Posts: 121
Default Code so that worksheets cannot be added to workbook

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Code so that worksheets cannot be added to workbook

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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
D D is offline
external usenet poster
 
Posts: 121
Default Code so that worksheets cannot be added to workbook

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?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Code so that worksheets cannot be added to workbook

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
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
How do I make VBA code usable on all worksheets of a workbook? tarobb Excel Programming 1 May 2nd 09 12:25 AM
How many total worksheets can be added to a workbook? Alberto Excel Discussion (Misc queries) 4 November 23rd 08 06:34 AM
HELP = VBA Code To Import Worksheets Into A WorkBook tommo_blade Excel Programming 7 July 3rd 08 07:56 PM
Rename worksheets of workbook - Error code [email protected] Excel Programming 1 July 21st 07 12:31 AM
macro to execute code on all worksheets in workbook Gretta Excel Programming 5 April 5th 07 03:44 PM


All times are GMT +1. The time now is 04:12 AM.

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

About Us

"It's about Microsoft Excel"