W
windsurferLA
I have several Excel workbooks that have custome menus. The workbooks
are set up so that the menus are generated when the workbooks are opened
and the menus are eliminated with the workbooks are closed. However, if
two workbooks are open at the same time, both sets of menus show on both
workbooks.
Some of the people that work for me end up running WorkbookA macros
(from menu) on WorkbookB, and vice versa. Would adding a test at the
beginning of each WorkbookA macro to make sure the active workbook is
WorkbookA prevent errors? If a Workbook is open but in a background
window or miniturized, is it still an "active workbook?"
Is there any way to prevent workbookA's menus from being visible in
WorkbookB if both are OPEN simultaneously?
The menu generation program was generously created by someone other than
myself, perhaps Joseph Rubin. I'm very much indebted to whoever wrote
the code, because it has made my workbooks a lot easier to use and
modify. The beginning of the code looks like:
Sub CreateMenu()
Dim MenuGen As Worksheet
Dim MenuObject As CommandBarPopup
Dim MenuItem As Object
Dim SubMenuItem As CommandBarButton
Dim Row As Integer
Dim MenuLevel, nextlevel, PositionOrMacro, Caption, Divider, FaceId
' Initialize the row counter
Row = 2
Do Until IsEmpty(MenuGen.Cells(Row, 1))
With MenuGen
MenuLevel = .Cells(Row, 1)
Caption = .Cells(Row, 2)
PositionOrMacro = .Cells(Row, 3)
Divider = .Cells(Row, 4)
FaceId = .Cells(Row, 5)
nextlevel = .Cells(Row + 1, 1)
End With
Thanks WindsurferLA
are set up so that the menus are generated when the workbooks are opened
and the menus are eliminated with the workbooks are closed. However, if
two workbooks are open at the same time, both sets of menus show on both
workbooks.
Some of the people that work for me end up running WorkbookA macros
(from menu) on WorkbookB, and vice versa. Would adding a test at the
beginning of each WorkbookA macro to make sure the active workbook is
WorkbookA prevent errors? If a Workbook is open but in a background
window or miniturized, is it still an "active workbook?"
Is there any way to prevent workbookA's menus from being visible in
WorkbookB if both are OPEN simultaneously?
The menu generation program was generously created by someone other than
myself, perhaps Joseph Rubin. I'm very much indebted to whoever wrote
the code, because it has made my workbooks a lot easier to use and
modify. The beginning of the code looks like:
Sub CreateMenu()
Dim MenuGen As Worksheet
Dim MenuObject As CommandBarPopup
Dim MenuItem As Object
Dim SubMenuItem As CommandBarButton
Dim Row As Integer
Dim MenuLevel, nextlevel, PositionOrMacro, Caption, Divider, FaceId
' Initialize the row counter
Row = 2
Do Until IsEmpty(MenuGen.Cells(Row, 1))
With MenuGen
MenuLevel = .Cells(Row, 1)
Caption = .Cells(Row, 2)
PositionOrMacro = .Cells(Row, 3)
Divider = .Cells(Row, 4)
FaceId = .Cells(Row, 5)
nextlevel = .Cells(Row + 1, 1)
End With
Thanks WindsurferLA