MrExcel Publishing
Your One Stop for Excel Tips & Solutions

calling a macro without referencing the module


Posted by vincent on December 18, 2000 10:43 AM

Hi,
I have one xla containing macros.
From another workbook, I would like to call one of those macro without adding a reference because I do not want to hardcode any path.
So what I do, I first I load the xla then ..... ?

Any hint ?


Posted by Bruce on December 18, 2000 11:55 AM

You could put a custom macro button into your formatting toolbar. First open the workbook containing the macro. Then select tools, customize, and select the commands tab. Scroll through the categories and select macro. On the command side, select custom button. Click on the smiley face and drag it to the formatting toolbar. Then click on modify selection, and select an icon button the suites you. Then click on the button on the tool bar. The first time you select this button, it will ask you which macro to attach to the button and run. This button will always be on your toolbar, and will work even if the workbook is not currently open. If you change your mind and want to get rid of the button, just hold down the ALT key, and drag the button off of the toolbar. It will be deleted.