Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto_Open only on initial file open

I have a spreadsheet that uses CB macro Auto_Open today
that makes a data request and populates my spreadsheet
the first time it is open. However, it does not rerun
this macro on subequent openings of this file. This is
my desired result.

I am creating a new spreadsheet that also populates
itself with a new set of data. However, every time I
save and open the file, it adds in more data and moves
the existing data to its right. This is not the desired
result. Is there a setting I am missing or should I use
a different command than Auto_Open. I do want this macro
to run the first time I open the file but just not
subsequent requests.

Thanks for your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Auto_Open only on initial file open

perhaps you could add the following line of code at the beginning of the
Auto_Open macro:

If Not IsEmpty(Worksheets("Sheet1").Range("A1").Value) Then Exit Sub

Where A1 is a cell that is populated when the file is opened for the first
time.

Gareth

"Joe Granda" wrote in message
...
I have a spreadsheet that uses CB macro Auto_Open today
that makes a data request and populates my spreadsheet
the first time it is open. However, it does not rerun
this macro on subequent openings of this file. This is
my desired result.

I am creating a new spreadsheet that also populates
itself with a new set of data. However, every time I
save and open the file, it adds in more data and moves
the existing data to its right. This is not the desired
result. Is there a setting I am missing or should I use
a different command than Auto_Open. I do want this macro
to run the first time I open the file but just not
subsequent requests.

Thanks for your help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default Auto_Open only on initial file open

Running a query?




--
John
johnf 202 at hotmail dot com


"Joe Granda" wrote in message
...
| I have a spreadsheet that uses CB macro Auto_Open today
| that makes a data request and populates my spreadsheet
| the first time it is open. However, it does not rerun
| this macro on subequent openings of this file. This is
| my desired result.
|
| I am creating a new spreadsheet that also populates
| itself with a new set of data. However, every time I
| save and open the file, it adds in more data and moves
| the existing data to its right. This is not the desired
| result. Is there a setting I am missing or should I use
| a different command than Auto_Open. I do want this macro
| to run the first time I open the file but just not
| subsequent requests.
|
| Thanks for your help.


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
How to locate auto_open preventing search for lost file? Tommy Excel Discussion (Misc queries) 1 March 15th 06 04:23 PM
How can I disable macros after the initial open? Troy Excel Discussion (Misc queries) 4 February 13th 06 03:38 PM
Auto_Open vs Open and call macro --priority question John Baker Excel Programming 3 December 7th 03 04:26 PM
Auto_Open not running when file opened normally Ron Ruble Excel Programming 11 September 21st 03 05:18 PM
Workbook Open Vs Auto_Open Soniya Excel Programming 2 September 18th 03 11:43 AM


All times are GMT +1. The time now is 08:38 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"