Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setTimer - causing exception errors?

Status
Not open for further replies.

ajbeer

Programmer
Jun 24, 2003
4
ES
In my VBA code in Excel, I am using the following function to call the Windows API setTimer

Sub StartTimer()
TimerSeconds = 300 ' how often to "pop" the timer.
TimerID = SetTimer(0&, 0&, TimerSeconds * 1000&, AddressOf TimerProc)
End Sub

I have only recently added this to my code. Previously I was just using an Excel timer.

Since changing the code I have had a few exception errors in Excel.

Could using the Windows API timer be causing these errors?

For example, if the Windows timer is not properly stopped (whilst debugging the code), would starting the timer again cause an exception error?

Any help on this would be very much appreciated.

Thanks.
 
Er...I'm assuming that you've have actually written the TimerProc code, and that it is bug free...
 
Yes, the code works fine.

The program is running fine at the moment.
I am just worried that I have had a few Excel exception errors, and just wondered whether it might be the fact that I am using a Windows API function that could have caused them.
I had no problems when using an VBA timer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top