G
Guest
I have a template which contains a macro, and I added a Custom Menu Item to
the Standard toolbar to execute the macro. But when a new workbook is created
using the template, the new menu item cannot execute the macro. I know it has
to do with the new workbook not having the same name as the template, but I
can't figure out how to have the menu item point to the macro in the new
workbook rather than the template workbook. I.e. In the custom menu item
named 'Compare BOMs' in the template I set Assign Macro... to 'CompareBOMs'.
When I look at the Assign Macro... again, I see that it is set to
'CompareVBDWBOMs.xlt!CompareBOMs'. I then save the template and create a new
workbook with it. Now, Assign Macro... is set to
'CompareVBDWBOMs1!CompareBOMs' and clicking the 'Compare BOMs' menu item says
the macro 'CompareVBDWBOMs1!CompareBOMs' cannot be found. The macro
'CompareBOMs' is in the ThisWorkbook object.
the Standard toolbar to execute the macro. But when a new workbook is created
using the template, the new menu item cannot execute the macro. I know it has
to do with the new workbook not having the same name as the template, but I
can't figure out how to have the menu item point to the macro in the new
workbook rather than the template workbook. I.e. In the custom menu item
named 'Compare BOMs' in the template I set Assign Macro... to 'CompareBOMs'.
When I look at the Assign Macro... again, I see that it is set to
'CompareVBDWBOMs.xlt!CompareBOMs'. I then save the template and create a new
workbook with it. Now, Assign Macro... is set to
'CompareVBDWBOMs1!CompareBOMs' and clicking the 'Compare BOMs' menu item says
the macro 'CompareVBDWBOMs1!CompareBOMs' cannot be found. The macro
'CompareBOMs' is in the ThisWorkbook object.