|
-
Jul 6th, 2005, 08:56 AM
#1
Thread Starter
Frenzied Member
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
-
Jul 6th, 2005, 09:06 AM
#2
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.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jul 6th, 2005, 09:10 AM
#3
Thread Starter
Frenzied Member
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 ?
-
Jul 6th, 2005, 09:16 AM
#4
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.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jul 6th, 2005, 09:22 AM
#5
Thread Starter
Frenzied Member
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
-
Jul 6th, 2005, 10:43 AM
#6
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 6th, 2005, 10:52 AM
#7
Thread Starter
Frenzied Member
Re: Disable Excel Menu options on startup
No because thats specific to the workbook and not the environment.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|