Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture Menu Click in Excel

Status
Not open for further replies.

SpyderMan1234

IS-IT--Management
Feb 26, 2004
35
US
Does anyone know of a way to capture the "Tools, Options..." event in Excel? I'm trying to capture this menu click action in an effort to hide several tabs on the options menu that I don't want my users to have access to. I know that I can do this with a customized tool-bar button, but ideally, I would like to just have an event triggered when the user click "Tools/Options" so that I can throw up my own customized form which hides the options I don't want them to see. If anyone has any ideas, I'd love to hear them.

Thanks in advance!
 
no real events for this - mnainly because it can all be set programmatically. Just disable the options on workbook open and reset them on workbook close

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
For single file, ThisWorkbook module, more WithEvents variables for each other button:
Code:
Public WithEvents cMB As Office.CommandBarButton

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Set cMB = Nothing
End Sub

Private Sub Workbook_Open()
' 'Options menu item
Set cMB = Application.CommandBars("Worksheet Menu Bar").FindControl(ID:=522, Recursive:=True)
End Sub

Private Sub cMB_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As Boolean)
CancelDefault = True
frmYourCustomUserForm.Show
End Sub

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top