ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code to auto update a footer (https://www.excelbanter.com/excel-programming/401662-code-auto-update-footer.html)

Valerie M

Code to auto update a footer
 
In Excel 2003 I have code in an Addin that inserts a document id into
the footer. Users run the code from a toolbar.

I need the code to automatically update itself when any workbook is
created, opened, saved or printed. If I put the event code (eg
Workbook_BeforeSave) into the addin, it only works for the addin
workbook. Is it possible to get the code to work for every workbook,
without having to add it to each workbook?

Bill Renaud

Code to auto update a footer
 
I haven't used this particular feature myself, but take a look at the
following topics in Microsoft Visual Basic Help:

Application Object Events
Using Events with the Application Object

In Excel 2000, these topics are a little hard to find. Start with any
workbook event that has the "Using Events..." link in it, click on that,
then click on the "See also" link at the top of the page, to gradually
drill down to the "Application Object Events" topic.

You might also refer to a few pages on Chip Pearson's web site:

"Application Events" (http://www.cpearson.com/excel/AppEvent.aspx)
"Events And Event Procedures In VBA"
(http://www.cpearson.com/excel/Events.aspx)

--
Regards,
Bill Renaud




Valerie M

Code to auto update a footer
 
Thanks Bill. That was exactly what I needed. Now I can control what
happens when opening, saving or printing any worksheet. Fantastic!


On Nov 28, 2:46 pm, "Bill Renaud"
wrote:
I haven't used this particular feature myself, but take a look at the
following topics in Microsoft Visual Basic Help:

Application Object Events
Using Events with the Application Object

In Excel 2000, these topics are a little hard to find. Start with any
workbook event that has the "Using Events..." link in it, click on that,
then click on the "See also" link at the top of the page, to gradually
drill down to the "Application Object Events" topic.

You might also refer to a few pages on Chip Pearson's web site:

"Application Events" (http://www.cpearson.com/excel/AppEvent.aspx)
"Events And Event Procedures In VBA"
(http://www.cpearson.com/excel/Events.aspx)

--
Regards,
Bill Renaud




All times are GMT +1. The time now is 02:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com