Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OnTime events

I am having trouble getting an Application.OnTime event to work. I a
typing in the code correctly, but when the time comes around, nothin
happens. I am using a test example from a VBA guide book, so I know th
code is written correctly. I just don't know why nothing happens. Ca
anyone help me

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default OnTime events

It would be helpful if you posted the code you are using.


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


"bambam77 " wrote in
message ...
I am having trouble getting an Application.OnTime event to

work. I am
typing in the code correctly, but when the time comes around,

nothing
happens. I am using a test example from a VBA guide book, so I

know the
code is written correctly. I just don't know why nothing

happens. Can
anyone help me.


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OnTime events

OOps Sorry

Sub SetAlarm()
Application.OnTime 0.625, "DisplayAlarm"
End Sub

Sub DisplayAlarm()
Beep
MsgBox "Wake up. It's time for break!"
End Sub

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default OnTime events

dir you run the subroutine SetAlarm?

You ran it and nothing happened at 3 PM.

You can test with a command like
Application.OnTime now + TimeValue("00:00:15"), "DisplayAlarm"

to have it run in 15 seconds.

--
Regards,
Tmo Ogilvy



"bambam77 " wrote in message
...
OOps Sorry

Sub SetAlarm()
Application.OnTime 0.625, "DisplayAlarm"
End Sub

Sub DisplayAlarm()
Beep
MsgBox "Wake up. It's time for break!"
End Sub.


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OnTime events

Ys, I ran the SetAlarm routine and nothing happened. i will try the code
you gave to try a test.


Thanks


---
Message posted from http://www.ExcelForum.com/



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OnTime events

Maybe I didn't run the Macro. I thought I didn't need to assign it to
button or anything to make it work. I thought it just work
automatically let me know if I'm wrong

--
Message posted from http://www.ExcelForum.com

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default OnTime events

You have to explicitly run the macro that schedules ontime to run. Ontime
then runs the scheduled macro at the scheduled time.

See Chip Pearson's page on this

http://www.cpearson.com/excel/ontime.htm

--
Regards,
Tom Ogilvy




"bambam77 " wrote in message
...
Maybe I didn't run the Macro. I thought I didn't need to assign it to a
button or anything to make it work. I thought it just works
automatically let me know if I'm wrong.


---
Message posted from http://www.ExcelForum.com/



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OnTime events

Thanks, the page helped a lot

--
Message posted from http://www.ExcelForum.com

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
Find %ontime & SUMIF ontime ie: find matching sets within Range... Chris T-M Excel Worksheet Functions 3 October 10th 08 08:14 PM
.ontime Grrrrrumpy Excel Discussion (Misc queries) 2 April 8th 07 04:18 PM
OnTime VB [email protected] Excel Discussion (Misc queries) 5 May 17th 06 10:53 PM
OnTime VB [email protected] Excel Worksheet Functions 2 May 16th 06 08:43 PM
OnTime...Please Help Michael_I Excel Programming 9 May 24th 04 07:56 PM


All times are GMT +1. The time now is 11:49 AM.

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"