Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Running a macro on a specific time

I would like to run a macro at a specific time every day automatically e.g. I
would like to run my macro at 12:00 GMT every day without having to do
anything (except writing the code of course). Is this possible and does Excel
and the spreadsheet has to be open in order for the macro to run? Please help
me! Thank you very much!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Running a macro on a specific time

Excel and the spreadsheet have to be open when the macro runs.

You can use the windows schedular to open excel/the workbook

In the workbook_Open event, put in code to trigger the code you want to run
and close Excel.

--
Regards,
Tom Ogilvy


"Viktor Ygdorff" wrote:

I would like to run a macro at a specific time every day automatically e.g. I
would like to run my macro at 12:00 GMT every day without having to do
anything (except writing the code of course). Is this possible and does Excel
and the spreadsheet has to be open in order for the macro to run? Please help
me! Thank you very much!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Running a macro on a specific time

Yes you can, Excel needs to remain open.

Use the following (you could put in the open workbook event)

Application.OnTime TimeValue("12:00:00"), "myCode"

At 12 noon the code myCode procedure runs at the end of the procedure the
event is retriggered to run again at 12:00:00

Sub myCode()
' this code runs at 12:00:00

' code here as required

' reset trigger for new start time
Application.OnTime TimeValue("12:00:00"), "mycode"
End Sub


Cheers
Nigel RS

"Viktor Ygdorff" wrote:

I would like to run a macro at a specific time every day automatically e.g. I
would like to run my macro at 12:00 GMT every day without having to do
anything (except writing the code of course). Is this possible and does Excel
and the spreadsheet has to be open in order for the macro to run? Please help
me! Thank you very much!

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
Disabling worksheet_change when running a specific macro . . Adam[_14_] Excel Programming 1 February 16th 06 06:24 AM
Running a macro at a specified time The Bobka Excel Discussion (Misc queries) 1 June 30th 05 05:25 PM
Macro running time Pradip Jain Excel Programming 2 April 22nd 05 01:50 PM
All time running macro gocush[_29_] Excel Programming 2 January 12th 05 03:19 PM
Running a macro at a certain time Dave Peterson[_3_] Excel Programming 0 October 17th 03 01:49 AM


All times are GMT +1. The time now is 08:17 PM.

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"