Auto Run Macro

  • Thread starter Thread starter chris6562
  • Start date Start date
C

chris6562

I currently have a macro that kickes off every 4 min's my problem i
that it kicks off just at random times.. closer to every 4 second..
this is my code


Public dTime As Date
Sub MyMacro()
dTime = Now + TimeValue("00:04:00")
Application.OnTime dTime, "MyMacro"

Any Ideas?
Chri
 
You're saying the macro should run every 4 minutes but it does run every 4
seconds about? Your Timevalue string looks right. You could try this
instead:

dTime = DateAdd("n",4, now)

Make sure you start with a fresh Excel.

--
Jim Rech
Excel MVP
|
| I currently have a macro that kickes off every 4 min's my problem is
| that it kicks off just at random times.. closer to every 4 second...
| this is my code
|
|
| Public dTime As Date
| Sub MyMacro()
| dTime = Now + TimeValue("00:04:00")
| Application.OnTime dTime, "MyMacro"
|
| Any Ideas?
| Chris
|
|
| --
| chris6562
| ------------------------------------------------------------------------
| chris6562's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=15772
| View this thread: http://www.excelforum.com/showthread.php?threadid=275287
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top