I bet this is an easy one, however damned if I can figure it.
I have the following code to add menus to a workbook upon opening it. From time to time, multiple versions of the same file are opened resulting in redundant menus. How can I check for a menus existence and not recreate it.
Guy
Sub Autpen()
AddAMenu
End Sub
Sub AddAMenu()
MenuBars(xlWorksheet).Menus.Add Caption:="Structure"
MenuBars(xlWorksheet).Menus("Structure").MenuItems.Add Caption:="Order By Assembly", OnAction:="ViewTree"
MenuBars(xlWorksheet).Menus("Structure").MenuItems.Add Caption:="Get Costing", OnAction:="GetCosts
I have the following code to add menus to a workbook upon opening it. From time to time, multiple versions of the same file are opened resulting in redundant menus. How can I check for a menus existence and not recreate it.
Guy
Sub Autpen()
AddAMenu
End Sub
Sub AddAMenu()
MenuBars(xlWorksheet).Menus.Add Caption:="Structure"
MenuBars(xlWorksheet).Menus("Structure").MenuItems.Add Caption:="Order By Assembly", OnAction:="ViewTree"
MenuBars(xlWorksheet).Menus("Structure").MenuItems.Add Caption:="Get Costing", OnAction:="GetCosts