ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Apllication.OnTime (https://www.excelbanter.com/excel-programming/303809-apllication-ontime.html)

Mischa Browne[_2_]

Apllication.OnTime
 
Goodday,

You can use "OnTime" method to schedule a macro to run at a specific time.

Is there also a method to schedule a macro to run at and/or after a specific
date (system-date)?



TKs,
Mischa





Peter Beach

Apllication.OnTime
 
Hi Mischa,

If you give a full date/time OnTime will work to that date. Something like:

Application.OnTime Date + 1 + Time(12,0,0), "MyRoutine"

will run at noon tomorrow.

HTH

Peter Beach

"Mischa Browne" wrote in message
...
Goodday,

You can use "OnTime" method to schedule a macro to run at a specific time.

Is there also a method to schedule a macro to run at and/or after a

specific
date (system-date)?



TKs,
Mischa







Mischa Browne[_2_]

Apllication.OnTime
 
Dear Peter,





Thanks, but does this mean I have to keep the workbook (that contains the
macro) active until tomorrow.

Or can I just open the workbook, tomorrow and then the macro will run?





MRegards,

Mischa



"Peter Beach" schreef in bericht
...
Hi Mischa,

If you give a full date/time OnTime will work to that date. Something

like:

Application.OnTime Date + 1 + Time(12,0,0), "MyRoutine"

will run at noon tomorrow.

HTH

Peter Beach

"Mischa Browne" wrote in message
...
Goodday,

You can use "OnTime" method to schedule a macro to run at a specific

time.

Is there also a method to schedule a macro to run at and/or after a

specific
date (system-date)?



TKs,
Mischa









Tom Ogilvy

Apllication.OnTime
 
It has to remain open.

--
Regards,
Tom Ogilvy

"Mischa Browne" wrote in message
...
Dear Peter,





Thanks, but does this mean I have to keep the workbook (that contains the
macro) active until tomorrow.

Or can I just open the workbook, tomorrow and then the macro will run?





MRegards,

Mischa



"Peter Beach" schreef in bericht
...
Hi Mischa,

If you give a full date/time OnTime will work to that date. Something

like:

Application.OnTime Date + 1 + Time(12,0,0), "MyRoutine"

will run at noon tomorrow.

HTH

Peter Beach

"Mischa Browne" wrote in message
...
Goodday,

You can use "OnTime" method to schedule a macro to run at a specific

time.

Is there also a method to schedule a macro to run at and/or after a

specific
date (system-date)?



TKs,
Mischa











Tom Ogilvy

Apllication.OnTime
 
Of course you could write code to save the scheduled date and time and
reinitiate the ontime event using the workbook_open event. But just setting
Ontime does not persist when you close excel. (I guess I should have said
you need to keep excel open - I don't believe you need to keep that specific
workbook open).

--
Regards,
Tom Ogilvy

"Mischa Browne" wrote in message
...
Dear Peter,





Thanks, but does this mean I have to keep the workbook (that contains the
macro) active until tomorrow.

Or can I just open the workbook, tomorrow and then the macro will run?





MRegards,

Mischa



"Peter Beach" schreef in bericht
...
Hi Mischa,

If you give a full date/time OnTime will work to that date. Something

like:

Application.OnTime Date + 1 + Time(12,0,0), "MyRoutine"

will run at noon tomorrow.

HTH

Peter Beach

"Mischa Browne" wrote in message
...
Goodday,

You can use "OnTime" method to schedule a macro to run at a specific

time.

Is there also a method to schedule a macro to run at and/or after a

specific
date (system-date)?



TKs,
Mischa











Mischa Browne[_2_]

Apllication.OnTime
 
So actually,

There is no code which allows a macro to run at a specific date?

Fe Monday July 19 2004 at or after 1 pm


Adios,
Mischa


"Tom Ogilvy" schreef in bericht
...
It has to remain open.

--
Regards,
Tom Ogilvy

"Mischa Browne" wrote in message
...
Dear Peter,





Thanks, but does this mean I have to keep the workbook (that contains

the
macro) active until tomorrow.

Or can I just open the workbook, tomorrow and then the macro will run?





MRegards,

Mischa



"Peter Beach" schreef in bericht
...
Hi Mischa,

If you give a full date/time OnTime will work to that date. Something

like:

Application.OnTime Date + 1 + Time(12,0,0), "MyRoutine"

will run at noon tomorrow.

HTH

Peter Beach

"Mischa Browne" wrote in message
...
Goodday,

You can use "OnTime" method to schedule a macro to run at a specific

time.

Is there also a method to schedule a macro to run at and/or after a
specific
date (system-date)?



TKs,
Mischa













Chip Pearson

Apllication.OnTime
 
Mischa,

Try

Application.OnTime DateSerial(2004,7,19) + TimeSerial(13,0,0),
"MacroName"

Note that Excel must remain open from the time you execute the
OnTime macro until the scheduled time.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Mischa Browne" wrote in message
...
So actually,

There is no code which allows a macro to run at a specific

date?

Fe Monday July 19 2004 at or after 1 pm


Adios,
Mischa


"Tom Ogilvy" schreef in bericht
...
It has to remain open.

--
Regards,
Tom Ogilvy

"Mischa Browne" wrote in message
...
Dear Peter,





Thanks, but does this mean I have to keep the workbook

(that contains
the
macro) active until tomorrow.

Or can I just open the workbook, tomorrow and then the

macro will run?





MRegards,

Mischa



"Peter Beach" schreef in bericht
...
Hi Mischa,

If you give a full date/time OnTime will work to that

date. Something
like:

Application.OnTime Date + 1 + Time(12,0,0), "MyRoutine"

will run at noon tomorrow.

HTH

Peter Beach

"Mischa Browne" wrote in message
...
Goodday,

You can use "OnTime" method to schedule a macro to run

at a specific
time.

Is there also a method to schedule a macro to run at

and/or after a
specific
date (system-date)?



TKs,
Mischa















Mischa Browne[_2_]

Apllication.OnTime
 
Can a user of the application bypass this option?

I want to protect my macro not to be used after a certain date.

Tks
Regards,
Mischa

"Chip Pearson" schreef in bericht
...
Mischa,

Try

Application.OnTime DateSerial(2004,7,19) + TimeSerial(13,0,0),
"MacroName"

Note that Excel must remain open from the time you execute the
OnTime macro until the scheduled time.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Mischa Browne" wrote in message
...
So actually,

There is no code which allows a macro to run at a specific

date?

Fe Monday July 19 2004 at or after 1 pm


Adios,
Mischa


"Tom Ogilvy" schreef in bericht
...
It has to remain open.

--
Regards,
Tom Ogilvy

"Mischa Browne" wrote in message
...
Dear Peter,





Thanks, but does this mean I have to keep the workbook

(that contains
the
macro) active until tomorrow.

Or can I just open the workbook, tomorrow and then the

macro will run?





MRegards,

Mischa



"Peter Beach" schreef in bericht
...
Hi Mischa,

If you give a full date/time OnTime will work to that

date. Something
like:

Application.OnTime Date + 1 + Time(12,0,0), "MyRoutine"

will run at noon tomorrow.

HTH

Peter Beach

"Mischa Browne" wrote in message
...
Goodday,

You can use "OnTime" method to schedule a macro to run

at a specific
time.

Is there also a method to schedule a macro to run at

and/or after a
specific
date (system-date)?



TKs,
Mischa

















Peter Beach

Apllication.OnTime
 
Hi Mischa,

Why not use something like:

Sub ExpiringMacro()
If Now DateSerial(2004,12,31) Then Exit Sub
. . . other code
End Sub

IOW simply stop the macro from running after the expiry date.

You could obviously get more sophisticated if you wanted to.

Regards,

Peter Beach

"Mischa Browne" wrote in message
...
Can a user of the application bypass this option?

I want to protect my macro not to be used after a certain date.

Tks
Regards,
Mischa

"Chip Pearson" schreef in bericht
...
Mischa,

Try

Application.OnTime DateSerial(2004,7,19) + TimeSerial(13,0,0),
"MacroName"

Note that Excel must remain open from the time you execute the
OnTime macro until the scheduled time.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Mischa Browne" wrote in message
...
So actually,

There is no code which allows a macro to run at a specific

date?

Fe Monday July 19 2004 at or after 1 pm


Adios,
Mischa


"Tom Ogilvy" schreef in bericht
...
It has to remain open.

--
Regards,
Tom Ogilvy

"Mischa Browne" wrote in message
...
Dear Peter,





Thanks, but does this mean I have to keep the workbook

(that contains
the
macro) active until tomorrow.

Or can I just open the workbook, tomorrow and then the

macro will run?





MRegards,

Mischa



"Peter Beach" schreef in bericht
...
Hi Mischa,

If you give a full date/time OnTime will work to that

date. Something
like:

Application.OnTime Date + 1 + Time(12,0,0), "MyRoutine"

will run at noon tomorrow.

HTH

Peter Beach

"Mischa Browne" wrote in message
...
Goodday,

You can use "OnTime" method to schedule a macro to run

at a specific
time.

Is there also a method to schedule a macro to run at

and/or after a
specific
date (system-date)?



TKs,
Mischa




















All times are GMT +1. The time now is 08:59 AM.

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