Run macro for all documents

  • Thread starter Thread starter Blackstar
  • Start date Start date
B

Blackstar

Hi,

I have to add a custom footer to every excel document based on an
enviromental variable. This isn't a problem I've got the vb/vba code
to do this. My problem is that I'm not really sure where to put it.

No matter what the document is or what template it is based on I need
to run this code. I was wondering if I should put it in Excel10.xlb or
is there somewhere else that is always checked for code?

If I put it in Excel10.xlb will I also need to put it in any existing
templates that are used?

Thanks
 
Blackstar said:
Hi,

I have to add a custom footer to every excel document based on an
enviromental variable. This isn't a problem I've got the vb/vba code
to do this. My problem is that I'm not really sure where to put it.

No matter what the document is or what template it is based on I need
to run this code. I was wondering if I should put it in Excel10.xlb or
is there somewhere else that is always checked for code?

If I put it in Excel10.xlb will I also need to put it in any existing
templates that are used?

Thanks

Edit the code must be run on save so it has to be in the ThisWorkbook
(Wookbook_BeforeSave) Method. So unfortunetly I don't beleive that
using personal.xls will work as this only seems to work for macros
rather than vba.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top