how to make macros available for all files

jazztech
04-07-2003, 07:02 AM
Hi Everybody

I am new, as it is going to be obvious from my question. I used macros to find certain cells (heading of data columns) running them from custom menu items. I had to reinstall everything on my PC so I lost these macros, however before that I had saved a *.bas file.

I imported this file but the macros only work in the Excel file in which I imported. Could someone tell me how I can make these macros available for all the Excel files, please?

Thanks,

Zoltan

Mill
04-07-2003, 07:06 AM
They should work for all of them, unless they are using the filename somewhere or the name of the Workbook.

jazztech
04-07-2003, 07:53 AM
Hi Mill,

Thanks, that was a really quick answer. Yes, you are right they refer to the workbook, in which I imported the bas file. But I don’t know how to avoid this. Here it is what I have done step by step, maybe this helps:
I opened Excel then from menu Tools>Macro>Visual Basic Editor
In the VBE File>Import File (as the Import File command cannot be used if there is no opened workbook, I opened one). I imported the bas file. I closed VBE and I set up the custom menu referring to the macros. I saved this workbook.

When I open another workbook, the menu items work fine as long as I did not delete the above workbook, so this is a solution but I guess there is a proper one.

Also could you tell me whether I can save these customized menus and reload them if I have to reinstall my PC again, please?

Thanks!!!

Zoltan

PS. Maybe I wasn’t specific enough before. I have to work with a lot of workbook and I want to avoid to load the macros again and again and to modify the menu.

Mill
04-07-2003, 08:15 AM
If I'm understanding you correctly, I think that you'll want to create an Add-In to do this. That way, your menus will be available to you as long as that Add-In is loaded (which would happen automatically if you wanted it to).

If your menus are added in the Workbook.Open event, then try saving the workbook as an Add-In (pick *.xla from the Save As type box).

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum