ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro to run automatically (https://www.excelbanter.com/excel-programming/273175-re-macro-run-automatically.html)

Michael Bednarek

macro to run automatically
 
On Wed, 30 Jul 2003 11:25:34 -0700, "Karon" wrote in
microsoft.public.excel.programming:

is it possible to have a macro run on it's own on a daily
basis without having to open the spreadsheet?


Yes.

1. Create a VBS file along these lines:

Set myApp = WScript.CreateObject("Excel.Application")
Set myBook = myApp.WorkBooks.Open("d:\path\workbook.xls")
myApp.Run("MyMacro")
myBook.Save ' if you want/need to
Set myBook=nothing
myApp.Quit
Set myApp = Nothing

2. Schedule a job (CSCRIPT.EXE) to run the above.

--
Michael Bednarek, IT Manager, Tactical Global Management
Waterfront Pl, Brisbane 4000, Australia. "POST NO BILLS"
http://mcmbednarek.tripod.com/


All times are GMT +1. The time now is 05:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com