PC Review


Reply
Thread Tools Rate Thread

Auto Open problem

 
 
Jim
Guest
Posts: n/a
 
      7th Dec 2007
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?
 
Reply With Quote
 
 
 
 
FSt1
Guest
Posts: n/a
 
      7th Dec 2007
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,B33,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

"Jim" wrote:

> 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?

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Auto Fit Sub on open =?Utf-8?B?UWFzcGVj?= Microsoft Excel Programming 8 22nd Mar 2007 08:58 PM
open up an excel program with an auto open macro john.9.williams@bt.com Microsoft Excel Programming 2 17th Jul 2005 04:48 PM
auto open, auto close mike allen Microsoft Excel Programming 1 31st Dec 2004 09:20 AM
Auto close, Auto Open Joyce O Microsoft Access Form Coding 3 23rd May 2004 12:53 AM
Problem With Auto Open Graham Microsoft Excel Programming 4 3rd Apr 2004 04:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:56 PM.