ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   clock use (https://www.excelbanter.com/excel-programming/426272-clock-use.html)

Curt

clock use
 
Is there a way to use the internal clock to take an action on a program on a
certain date. This would need to happen with the program closed or open.

FSt1

clock use
 
hi
a quick dirty way might be something like this....
with a date in C2....
Sub ttttt()
If Now c2 Then 'or another cell
[A2].Value = "now" 'do something
Else
[A2] = "not now" 'do something else
End If
'MsgBox Now 'test compare
End Sub

there are other ways to zero in on a date or day.
If Weekday(Now()) = 2 'it's monday
do something
else
do something esle
end if

you could also look it the ontime event. see this site...
http://www.cpearson.com/excel/OnTime.aspx

lot of ways to handle this one.

regards
FSt1

"Curt" wrote:

Is there a way to use the internal clock to take an action on a program on a
certain date. This would need to happen with the program closed or open.


FSt1

clock use
 
forgot to mention...
what ever method you finally choose, put the code in the workbook open event
or the before close event

regards
FSt1

"FSt1" wrote:

hi
a quick dirty way might be something like this....
with a date in C2....
Sub ttttt()
If Now c2 Then 'or another cell
[A2].Value = "now" 'do something
Else
[A2] = "not now" 'do something else
End If
'MsgBox Now 'test compare
End Sub

there are other ways to zero in on a date or day.
If Weekday(Now()) = 2 'it's monday
do something
else
do something esle
end if

you could also look it the ontime event. see this site...
http://www.cpearson.com/excel/OnTime.aspx

lot of ways to handle this one.

regards
FSt1

"Curt" wrote:

Is there a way to use the internal clock to take an action on a program on a
certain date. This would need to happen with the program closed or open.


Dave Peterson

clock use
 
You can use application.ontime, but then Excel has to be kept open. And at
least one workbook had to be opened to set this in motion.

Chip Pearson has lots of info he
http://www.cpearson.com/excel/OnTime.aspx

If excel is not going to be open, maybe you can use a windows(?) scheduling
program. Some versions of windows have them built in, but there are free (and
$$) versions you can find via google.



Curt wrote:

Is there a way to use the internal clock to take an action on a program on a
certain date. This would need to happen with the program closed or open.


--

Dave Peterson

Dave Peterson

clock use
 
Ps. The excel program that starts the process can close after the OnTime is
run. But excel has to stay open.

With the windows scheduling program, you'd have to have the PC on and allow
macros to run (you are running macros in excel, right) when that scheduling
starts excel with your workbook.

Curt wrote:

Is there a way to use the internal clock to take an action on a program on a
certain date. This would need to happen with the program closed or open.


--

Dave Peterson

RB Smissaert

clock use
 
You can use Edanmo's free task scheduler:
http://www.mvps.org/emorcillo/en/code/vb6/
It is at the bottom of the page.

RBS


"Dave Peterson" wrote in message
...
You can use application.ontime, but then Excel has to be kept open. And
at
least one workbook had to be opened to set this in motion.

Chip Pearson has lots of info he
http://www.cpearson.com/excel/OnTime.aspx

If excel is not going to be open, maybe you can use a windows(?)
scheduling
program. Some versions of windows have them built in, but there are free
(and
$$) versions you can find via google.



Curt wrote:

Is there a way to use the internal clock to take an action on a program
on a
certain date. This would need to happen with the program closed or open.


--

Dave Peterson




All times are GMT +1. The time now is 02:23 AM.

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