#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default 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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default 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


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
Incremental time values based upon clock in and clock out times saltnsnails Excel Discussion (Misc queries) 8 January 13th 09 08:11 PM
Time Clock - Making sure they clock out valiant Excel Programming 1 June 4th 08 03:22 PM
How do I calculate time in excel (clock in and clock out chad Excel Discussion (Misc queries) 3 January 7th 08 10:09 PM
Change EXCEL Clock to Standard Clock or Military Time YoMarie Excel Worksheet Functions 4 April 29th 07 08:39 PM
Start Clock/Stop Clock abfabrob Excel Discussion (Misc queries) 9 June 28th 05 04:26 PM


All times are GMT +1. The time now is 01:42 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"