O
Orion Cochrane
I have a custom menu I use with personal macros used for different purposes.
Sometimes my settings get wiped out in Excel and I need to re-create the menu
from scratch. Can anyone tell me how to create the menu through VBA so that I
can trigger it in my PERSONAL.xls Workbook_Open routine?
The main menu control is called Reports, positioned at the end of the
Worksheet Menu Bar (CommandBars(1)). Reports has 2 sub-menus: Credit Cards,
and Petty Cash. When you click the Reports Menu, MenuEnable is triggered.
Credit Cards has 3 sub-menus: All, Current, and Journal Entry. All has 4
items (with macros): Run and/or Print Statements (CreditCardRunAll), Print
all Statements (CreditCardPrintAll), Clear Subtotals Only
(CreditCardClearSubtotalsAll), and Clear all Statements
(CreditCardClearReportAll). Current has 2 items (with macros): Run Statement
(CreditCardRunCurrent), and Clear Subtotals
(CreditCardClearSubtotalsCurrent). Journal Entry has 2 items (with macros):
Generate Journal Entry (CreditCardJE), and Clear Journal Entry
(CreditCardJEClear).
Petty Cash has 2 items (with macros): Run Report (PettyCashRun), and Run
Journal Entry (PettyCashJE).
The table below summarizes this post (hopefully it shows up nice).
All I need is code to create this menu and map the right macros to each
item. This will save me a lot of time if it can be done. Big thanks in
advance.
Name Type Macro
Reports Control MenuEnable
Credit Cards Control (None)
All Control (None)
Run and/or Print Statements Item CreditCardRunAll
Print all Statements Item CreditCardPrintAll
Clear Subtotals Only Item CreditCardClearSubtotalsAll
Clear all Statements Item CreditCardClearReportAll
Current Control (None)
Run Statement Item CreditCardRunCurrent
Clear Subtotals Item CreditCardClearSubtotalsCurrent
Journal Entry Control (None)
Generate Journal Entry Item CreditCardJE
Clear Journal Entry Item CreditCardJEClear
Petty Cash Control (None)
Run Report Item PettyCashRun
Run Journal Entry Item PettyCashJE
Sometimes my settings get wiped out in Excel and I need to re-create the menu
from scratch. Can anyone tell me how to create the menu through VBA so that I
can trigger it in my PERSONAL.xls Workbook_Open routine?
The main menu control is called Reports, positioned at the end of the
Worksheet Menu Bar (CommandBars(1)). Reports has 2 sub-menus: Credit Cards,
and Petty Cash. When you click the Reports Menu, MenuEnable is triggered.
Credit Cards has 3 sub-menus: All, Current, and Journal Entry. All has 4
items (with macros): Run and/or Print Statements (CreditCardRunAll), Print
all Statements (CreditCardPrintAll), Clear Subtotals Only
(CreditCardClearSubtotalsAll), and Clear all Statements
(CreditCardClearReportAll). Current has 2 items (with macros): Run Statement
(CreditCardRunCurrent), and Clear Subtotals
(CreditCardClearSubtotalsCurrent). Journal Entry has 2 items (with macros):
Generate Journal Entry (CreditCardJE), and Clear Journal Entry
(CreditCardJEClear).
Petty Cash has 2 items (with macros): Run Report (PettyCashRun), and Run
Journal Entry (PettyCashJE).
The table below summarizes this post (hopefully it shows up nice).
All I need is code to create this menu and map the right macros to each
item. This will save me a lot of time if it can be done. Big thanks in
advance.
Name Type Macro
Reports Control MenuEnable
Credit Cards Control (None)
All Control (None)
Run and/or Print Statements Item CreditCardRunAll
Print all Statements Item CreditCardPrintAll
Clear Subtotals Only Item CreditCardClearSubtotalsAll
Clear all Statements Item CreditCardClearReportAll
Current Control (None)
Run Statement Item CreditCardRunCurrent
Clear Subtotals Item CreditCardClearSubtotalsCurrent
Journal Entry Control (None)
Generate Journal Entry Item CreditCardJE
Clear Journal Entry Item CreditCardJEClear
Petty Cash Control (None)
Run Report Item PettyCashRun
Run Journal Entry Item PettyCashJE