Auto Open problem

J

Jim

I have a template file that has a macro that runs on Private Sub
Workbook_Open() in the "ThisWorkbook". the macro triggers other routines to
find a file and copy it's contents to a particualr sheet etc. This works fine
on opeinng the Template file

I have a button assigned to a macro that will reopen the Template file if
the user wants to restart the routine. I get the usual message that
reopeinng the file will cause any changes you made to be disregarded...etc.
However, when the file is opened Private Sub Workbook_Open() doesn't run.

Any ideas?
 
F

FSt1

hi
i'm guess that the workbook open macro doesn't run becasue technically the
file is already open. and the unusual message about losing data...not
unsusal. standard. you are replacing the file in memory with a file from the
disk.
and reopening the file to restart the routine may be an inefficent way of
going about it. I would do a surgical clear contents ie
range("A1,B3:D3,E3:E6,H4").ClearContents
to clear the template then use the call method to call other routine that
need to run.
I haven't seen your setup so i'm guess that this would be a better way or at
least the way i would try to go about it.

my thoughts
Regards
FSt1
 

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