Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need to refresh external data in Excel automatically, daily

Status
Not open for further replies.

amynboys

Programmer
Aug 2, 2001
2
US
I have an excel spreedsheet that gets external data through query. I need a way to refresh this data on a daily basis automatically, without human intervention. Can someone help me with this? Thanks in advance.

Amy
 
Right click in the data sheet that the query returns data to, select properties then select the option to refresh on open
 
It sounds like ETID is assuming you're query is an Access query.

Actually, I think this will require VBA code and I'm not sure if the VBA code will run unless the file is opened. However, if we get the code, perhaps you could put the file in your startup folder so that it is opened automatically when the PC is turned on.

Then, the VBA code would have the setting to update at a specific time or on open of the file. This depends on you. When would you like the data refreshed?
techsupportgirl@home.com
Brainbench MVP for Microsoft Word
 
What I was wanting to do is have the data refresh each night around 8pm when noone is around. I'm an AS/400 programmer and trying to manipulate data in excell is new to me. But, the idea i had was to create a macro that opens and closes the file. Then if I could run this macro in a batch file I could schedule it to run at a certain time at night. Is this possible? Or is there a better way to accomplish it? Thanks.
 
A macro won't open the file. You'll need a VB or other program to do that.

Running the macro on open would then work. Or, you can (I'm almost certain) set a special time for it to update. Though you could probably just do it on open and have the VB or other program open it at the given time.

Check with the VBers forum, if you like. I'm not any good at it, though I do own it.
techsupportgirl@home.com
Brainbench MVP for Microsoft Word
 
If you can start an excel spreadsheet from your batch,...you can set a macro in that workbook to run on start up, and by the way, I too query agains as400 files using the client access odbc driver and it will link and refresh on opening of the spreadsheet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top