Disable Excel Menu options on startup
I know there are a couple of macros that are used for this purpose ... something like "AutoExecute" or something like that.
Its been aaaaaaaaaaaaaaaaaaaages since I did this ... and due to the permanent detrimental affects of alcohol I can't remember how to do it.
Basically, when you open excel is there any way of creating a macro which removes either a) the whole pull down menu or b) indiv items on the pull-down menu.
Sorry and Thanks .... for being so stupid and for helping ... in that order :)
Re: Disable Excel Menu options on startup
Event of the loading spreadsheet?
Commandbars (in the microsoft office x.x objects reference).
Your choice whether to loop and .find controls then enable, visible etc them...
or just get rid of the menus.
All toolabrs and menus are commandbars, and you can make them all disappear in a loop should you want to.
Re: Disable Excel Menu options on startup
Yes in the loading of the spreadsheet.
I'm not referring to any custon custom menus, I'm referring purely to the default ones, say for example if you wanted to disable the "Save" and "Save As" options in the "File" pull down menu.
Isn't there a standard amcro called "AutoExecute" that yuo can use that will execute when Excel starts up ? Or did I dream that ?
Re: Disable Excel Menu options on startup
There is an autoexecute macro (not vba) in Access.
As to specifiy, you could loop through all the controls (using .find I think or just moving through all the controls) and check their captions (replace & with "") to see if they are like Save ... then you can .enable=false on them. Whether Excel would change that if the user loaded a new sheet, or created a new sheet, you'd have to test.
Re: Disable Excel Menu options on startup
If I remember correctly there is an option to say "temporary change" or "permanent change"
The temporary change only lasts as long as that particular session of Excel is open.
The permanent one obviously lasts indefinately.
There IS an "AutoExecute" standard macro in Excel, because I have used it before.
Not sure if thats the correct name for it though.
A sample of code from someone would be good, because like anyone who knows me will tell .... I'm bl**dy lazy :)
Re: Disable Excel Menu options on startup
Wouldnt you just use the _Open event?
VB Code:
Private Sub Workbook_Open()
MsgBox "Hi"
End Sub
Note: In Excel you can disable the code from running by holding down the shift key when starting Excel.
Re: Disable Excel Menu options on startup
No because thats specific to the workbook and not the environment.