Copying ThisWorkBook Events

G

Guest

I have to create 40+ workbooks from a single "template" workbook. These
workbooks will be used by collegues throughout the organization during their
daily analysis of financial data. One of the goals of these workbooks is to
sort the corresponding rows based on a specific column (column L). This sort
needs to occur only during the BeforeSave event and needs to be transparent
to the user.

I wanted to put the sort code in the ThisWorkBook BeforeSave event and
programatically use VBE to create the component in each of the 40+ workbooks.
Unfortnately, the "template" workbook's BeforeSave event code will not copy
to the 40+ workbooks. I also tried creating a separate class module to
handle event programming and this works only if I have a reference to the
event class from the newly created workbook.

Since I will have to have this code in 40+ workbooks, I wanted to see if
anyone knew how to copy the Thisworkbook's BeforeSave code to other workbooks?

Thanks for the help.
 
T

Tom Ogilvy

Export the code, then import it into the target workbook(s).

Regards,
Tom Ogilvy
 
G

Guest

Tom,

Thanks for the reply. I thought of exporting the code and manually
importing it, but this is a daunting task for 40+ workbooks on a daily basis.
Any idea on how to do this programmatically?
 

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

Top