Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello guys,
I would like to schedule a macros So first of all I would like to open an external program from excel calling PLauch, once the program open I would like to execute my macro "operations" and once the macro finished I would like to save it somewhere. But I am not very convinient with Application.Ontime and schedule macro. This is my code Public Sub Workbook_Open() On Error GoTo ErrHand Dim dtmTime As Date Dim dtmSave As Date OpenPLaunch ' I launch the program dtmTime = Now + TimeValue("00:00:15") Application.OnTime dtmTime, "operations" Application.DisplayAlerts = False ActiveWorkbook.SaveAs Filename:= _ "C:\test\test.xls", FileFormat:=xlHtml, ReadOnlyRecommended:=False, CreateBackup:=False 'Application.DisplayAlerts = True 'dtmSave = dtmTime + TimeValue("00:01:00") 'I would like to have the exact time after macro is finished 'Application.OnTime dtmSave, "Save_Exit" ErrHand: MsgBox "error" End Sub Sub operations() Sheet1.Activate Sheet1.GetInfo Sheet2.Activate Sheet2.AllClients End Sub Sub Save_Exit() Application.Quit ThisWorkbook.Close SaveChanges:=True End Sub Could someone help me with this issue? Thanks ina |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See www.cpearson.com/excel/ontime.htm for details and example
code. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "ina" wrote in message oups.com... Hello guys, I would like to schedule a macros So first of all I would like to open an external program from excel calling PLauch, once the program open I would like to execute my macro "operations" and once the macro finished I would like to save it somewhere. But I am not very convinient with Application.Ontime and schedule macro. This is my code Public Sub Workbook_Open() On Error GoTo ErrHand Dim dtmTime As Date Dim dtmSave As Date OpenPLaunch ' I launch the program dtmTime = Now + TimeValue("00:00:15") Application.OnTime dtmTime, "operations" Application.DisplayAlerts = False ActiveWorkbook.SaveAs Filename:= _ "C:\test\test.xls", FileFormat:=xlHtml, ReadOnlyRecommended:=False, CreateBackup:=False 'Application.DisplayAlerts = True 'dtmSave = dtmTime + TimeValue("00:01:00") 'I would like to have the exact time after macro is finished 'Application.OnTime dtmSave, "Save_Exit" ErrHand: MsgBox "error" End Sub Sub operations() Sheet1.Activate Sheet1.GetInfo Sheet2.Activate Sheet2.AllClients End Sub Sub Save_Exit() Application.Quit ThisWorkbook.Close SaveChanges:=True End Sub Could someone help me with this issue? Thanks ina |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you
Ina |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
killing an OnTime schedule launched from a different workbook | Excel Discussion (Misc queries) | |||
Application OnTime...need some help to schedule. | Excel Programming | |||
application.ontime | Excel Programming | |||
Application.OnTime -- Unable to Pass Macro with Numeric Parameter | Excel Programming | |||
Application.OnTIme | Excel Programming |