Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have tried to use Mike H's answer to Running Excel macro as a service
dated 9/30/2008. I have us the task Scheduler to open the Excel Workbook containing the macro I want to run with a time of 2:00 AM. When I put the code Application.OnTime TimeValue("02:01:00"), "Merge" as the first line of the Macro Merge, nothing happens when 02:01:00 comes. What am I doing wrong? Jim Walsh |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
To get the macro to run using ontime you have to start things off like this Private Sub Workbook_Open() Application.OnTime TimeValue("02:00:00"), "Merge" End Sub or you can put it in another sub and run that and at the alloted time your macro will run Sub Get_Things_Going() Application.OnTime TimeValue("02:00:00"), "Merge" End sub Sub Merge() 'Your code End Sub -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "jswalsh33" wrote: I have tried to use Mike H's answer to Running Excel macro as a service dated 9/30/2008. I have us the task Scheduler to open the Excel Workbook containing the macro I want to run with a time of 2:00 AM. When I put the code Application.OnTime TimeValue("02:01:00"), "Merge" as the first line of the Macro Merge, nothing happens when 02:01:00 comes. What am I doing wrong? Jim Walsh |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Mike, That worked fine.
Jim Walsh "Mike H" wrote: Hi, To get the macro to run using ontime you have to start things off like this Private Sub Workbook_Open() Application.OnTime TimeValue("02:00:00"), "Merge" End Sub or you can put it in another sub and run that and at the alloted time your macro will run Sub Get_Things_Going() Application.OnTime TimeValue("02:00:00"), "Merge" End sub Sub Merge() 'Your code End Sub -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "jswalsh33" wrote: I have tried to use Mike H's answer to Running Excel macro as a service dated 9/30/2008. I have us the task Scheduler to open the Excel Workbook containing the macro I want to run with a time of 2:00 AM. When I put the code Application.OnTime TimeValue("02:01:00"), "Merge" as the first line of the Macro Merge, nothing happens when 02:01:00 comes. What am I doing wrong? Jim Walsh |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro / function text time to 24hr excel time passed midnight fortotaling hr's | Excel Worksheet Functions | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Worksheet Functions | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Discussion (Misc queries) | |||
Time 24:00:00 in macro | Excel Discussion (Misc queries) | |||
Can I get a macro to run at a certain time of day? | Excel Discussion (Misc queries) |