Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
menu bars
Firstly my apologies for lots of posts - I am polishing up a nearly
completed sheet and so have lots of niggles that I need help with. I currently use cells on a sheet of my workbook which activate VBA (in a similar way that buttons might). However I am thinking I could do this a much neater way - by using custom menus (which i have never done before). However to make it user friendly I would like to get rid of all other menu commands and just have one menu - my own - which alongised my custom commands would have the save and close features. Is this possible? If so how would I go about doing this (if anybody can point me to some online sites to help a newbie on this i would appreciate it) What happens if somebody had 2 excel sheets open at once - would mine have the custom menu bar and the other have the normal menu bar, or would the custom bar apply to them both? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
menu bars
Option Explicit Private mFormulaBar Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim oCB As CommandBar For Each oCB In Application.CommandBars oCB.Enabled = True Next oCB Application.DisplayFormulaBar = mFormulaBar End Sub Private Sub Workbook_Open() Dim oCB As CommandBar For Each oCB In Application.CommandBars oCB.Enabled = False Next oCB mFormulaBar = Application.DisplayFormulaBar Application.DisplayFormulaBar = False End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "anon" wrote in message oups.com... Firstly my apologies for lots of posts - I am polishing up a nearly completed sheet and so have lots of niggles that I need help with. I currently use cells on a sheet of my workbook which activate VBA (in a similar way that buttons might). However I am thinking I could do this a much neater way - by using custom menus (which i have never done before). However to make it user friendly I would like to get rid of all other menu commands and just have one menu - my own - which alongised my custom commands would have the save and close features. Is this possible? If so how would I go about doing this (if anybody can point me to some online sites to help a newbie on this i would appreciate it) What happens if somebody had 2 excel sheets open at once - would mine have the custom menu bar and the other have the normal menu bar, or would the custom bar apply to them both? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
menu bars
Thanks.
However this still creates a problem - users are likely to have more than this one excel file open at once - and if they do then there are no menu bars on their other files either. Is there a way round this? Also this hides a customer menu bar - can I leave this visible? Is there a way for a custom meu bar only to be visible in one excel file (ie this one) and not in any others? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
menu bars
Put it in the Workbook_Activate and Workbook_Deactivate events instead of
Workbook_Open and Workbook_BeforeClose. And Unhide your menu after all the rest were hidden. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "anon" wrote in message ups.com... Thanks. However this still creates a problem - users are likely to have more than this one excel file open at once - and if they do then there are no menu bars on their other files either. Is there a way round this? Also this hides a customer menu bar - can I leave this visible? Is there a way for a custom meu bar only to be visible in one excel file (ie this one) and not in any others? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
menu bars
Bob
You're a genius! Thanks again for your help. This is perfect |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
menu bars
One final question - if I now try to add std buttons to my custom
toolbar they are greyed out. Is this caused by this code and can I change this? |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
menu bars
Ignore the above .... one day i'll learn not to post before trying
things out! Thanks again |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Menu Bars | Excel Programming | |||
Lost all my menu bars and tool bars | Excel Discussion (Misc queries) | |||
New Menu on Worksheet & Chart Menu Bars | Excel Programming | |||
linking chart menu bars and worksheet menu bars | Excel Programming | |||
menu bars | Excel Programming |