If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Disable right click on Sheet tabs

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-07-05, 16:44
bhavesh78 bhavesh78 is offline
Registered User
 
Join Date: Dec 2004
Posts: 78
Disable right click on Sheet tabs

Is there a way to disable right click on Sheet tabs (Sheet1, Sheet2, Sheet3...) so that user cannot create/insert a new worksheet.

Thanks.

~BS
Reply With Quote
  #2 (permalink)  
Old 02-08-05, 05:40
DavidCoutts DavidCoutts is offline
Registered User
 
Join Date: Jan 2004
Location: Aberdeen, Scotland
Posts: 1,067
Protect the workbook structure this will prevent insertion deletion or moving of worksheets

you can turn it on and off in code like this

Code:
Sub test()
    ThisWorkbook.Protect "abc", True
End Sub

Sub testoff()
    ThisWorkbook.Unprotect "abc"
End Sub
Reply With Quote
  #3 (permalink)  
Old 02-09-05, 20:09
bhavesh78 bhavesh78 is offline
Registered User
 
Join Date: Dec 2004
Posts: 78
I am using the following code to lock my worksheets (though I am allowing users to format rows and columns). Is there a way to disable right click on sheet tabs using this?


Code:
ActiveSheet.Protect Password:=12345
ActiveSheet.EnableOutlining = True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:=PWord, UserInterfaceOnly:=True, AllowSorting:=True, AllowFormattingColumns:=True, AllowFormattingRows:=True, AllowFormattingCells:=True
Thanks.

~BS.
Reply With Quote
  #4 (permalink)  
Old 02-10-05, 02:50
DavidCoutts DavidCoutts is offline
Registered User
 
Join Date: Jan 2004
Location: Aberdeen, Scotland
Posts: 1,067
nope all of the sheet tabs events are associated with the workbook,
i think its the contents but id have to look it up to be sure

if you proyect the workbook as above the delet and move and insertion of worksheets should be disabled
Reply With Quote
  #5 (permalink)  
Old 02-10-05, 16:31
bhavesh78 bhavesh78 is offline
Registered User
 
Join Date: Dec 2004
Posts: 78
Thumbs up

Thanks David. I am using the following code. This locks the worksheet, but at the same time allows me to change column/row width and allows to expand/contract grouped rows and columns.

Code:
ActiveWorkbook.Protect Structure:=True, Windows:=False, Password:=12345
ActiveSheet.EnableOutlining = True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:=PWord, UserInterfaceOnly:=True, AllowSorting:=True, AllowFormattingColumns:=True, AllowFormattingRows:=True, AllowFormattingCells:=True
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On