#1   Report Post  
Posted to microsoft.public.excel.misc
Jim Jim is offline
external usenet poster
 
Posts: 615
Default Auto Open problem

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Auto Open problem

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

"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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
auto open message pcor New Users to Excel 8 September 19th 07 01:25 PM
Auto-Open other file aposatsk Excel Discussion (Misc queries) 5 September 28th 06 09:37 PM
Auto open a .xlt template Khoa New Users to Excel 2 July 26th 06 06:54 AM
how do you switch from auto open Jay Excel Discussion (Misc queries) 3 July 18th 05 04:29 PM
Auto Open Syed Zeeshan Haider Excel Discussion (Misc queries) 2 June 1st 05 03:39 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"