Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See if this works for you
Option Explicit Public WithEvents App As Application Private Sub App_WindowActivate(ByVal Wb As Workbook, ByVal Wn As Window) Dim win As Window Dim cnt As Long For Each win In Application.Windows cnt = cnt - win.Visible Next win If cnt 1 Then Application.Commandbars("myMenu").Enabled=True End Sub Private Sub App_WindowDeactivate(ByVal Wb As Workbook, ByVal Wn As Window) Dim win As Window Dim cnt As Long For Each win In Application.Windows cnt = cnt - win.Visible Next win If cnt = 1 Then Application.Commandbars("myMenu").Enabled=False End Sub Private Sub Workbook_Open() Set App = Application 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 Phillips (replace somewhere in email address with gmail if mailing direct) "Piers 2k" wrote in message ... Hi folks, Have a file on a public drive which is opened by a number of users using Alt Startup Location configured in options. Workbook is hidden, and Open and BeforeClose events work correctly to create and drop a custom menu. All fine. Except when no workbooks are open, the menu isn't disabled in any way. Is there a way to disable the entire menu or certain items when no other files are open? TIA, Piers |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do i save a custom footer in the excel drop down menu? | Excel Discussion (Misc queries) | |||
custom menu doesn't drop down via shortcut | Excel Programming | |||
custom menu doesn't drop down via shortcut | Excel Programming | |||
custom menu doesn't drop down via shortcut | Excel Programming | |||
Custom Menu return to Excel Menu upon Closing | Excel Programming |