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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a spreadsheet macro every 30 mins

Status
Not open for further replies.

Warlocks

Technical User
Jan 9, 2003
79
GB
Hi,

I have a spreadsheet which has a macro in it that updates the spreadsheet.
The update macro takes about 3 or 4 minutes to update and save the spreadsheet so I wanted to do the time consuming updates in the background (current thinking was on the server via scheduled tasks).

As you can't run a macro directly from the command line (unless this has changed), one thought was to create a dummy Excel sheet with some code in the Workbook_Open() function to open the desired spreadsheet, run the procedure/macro, save the workbook and then close... all seamlessly in the background.

If I am not able to run from the command line, how can I run a macro from a different spreadsheet?

Cheers,

Woody.
 



Hi,

Is you macro security set to LOW, which is rather dangerous in today's world?

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 



Why not use OnTime to run Now + minutes in a separate instance from your Excel? Leave it open all day.

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
You can not execute a macro from a command line? You can with Word using the /m switch.

Winword.exe /mmacroname

Gerry
 
I've managed to sort it now thanks.

I didn't want anything set on Workbook open but wanted to ensure it updated every 15 mins even if the server was rebooted for any reason.

I therefore created a dummy Excel file which, on Workbook Open opened my main excel file and ran the macro as it if was run from the main file. I then set the dummy process up to run from a Scheduled Task (as I no longer required any MACRO switches)...

Cheers,

Woody.
 
There is a new free Web Service out there called Web-Sheets that will handle server side excel creation and return you the URL link to your Excel file.

Works really good and simple to setup. You just send the web service an XML formatted string of the data you want populated and then it turns that into an excel document server side and kicks back the URL linking the excel file. Has formatting options and supports formulas.

See the link below for examples and more info:

Check it out
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top