Adding an Auto Exec macro?

W

WhytheQ

Quite an interesting problem.

WorkbookA contains the main routine and consists of 4 sheets.
When the routine is run sheet1 and sheet2 are copied and saved to a
different drive and emailed to a recipient
This is repeated several times.

I'd like it so that when the recipients open the file an autoexec
macro fires which simply does the following:

Sub() Auto_Open
Application.Calculation=xlAutomatic
End sub

Is there a way for me to attach this macro to each of the produced
files without programming the VBE (i.e programmatically creating a
module and adding in the above macro)?

Any help greatly appreciated
J
 
R

Ronald Dodge

Actually, the code would be in a standard module like:

Private Sub Auto_Open()
Application.Calculation=xlAutomatic
End sub

However, unless you setup a file with this code in it already and to be used
as a template file, you would have to mess with the VBE programming stuff.
You could then save a copy of Sheet1 and Sheet2 into a copy of the template
file, then save and mail that copy of the template file.

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000
 
W

WhytheQ

Thanks Ronald - I'll give the template a go (although programming the
VBE might be fun as it isn't something I've tried before)

J
 

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