LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OnTimer - The macro 'macro name' cannot be found.

I am trying to use the OnTimer event to run a macro every 60 seconds while a
workbook is open.

I found lots of examples on the net and the example below on this site.

Regardless of which example I use I always get this error message when the
OnTimer event is triggered

The macro 'macro name' cannot be found.

I have tried this on several Computers - Staff machines, student lab
machines, admin assistant machines, and they all produce the same error
message each time, and the Macro Security level is set to the Not recomended
Low setting, so I know its not a fault with my PC.

We use Office 2003 with SP 3

I am writing a templating system/procedure for excel to allow Lecturers to
produce student excel template lab exercises that will reduce the temptation
for students to cheat ( cut/paste other people work, submit another's
workbook etc). The ontimer event is ment to show the lab demostrators in real
time how long the student has been working on the exercise, was they walk
around the lab.

//------------------------------------------
Private mNextTime As Double
Private mCounter As Long ' for test routine

Sub OnTimer()
mNextTime = Now + (TimeSerial(0, 0, 1))
Application.OnTime mNextTime, "myMacro"
End Sub

Sub StopTimer()
' call StopTimer in the workbook's close event or antime to stop the OnTime

If mNextTime Then Application.OnTime mNextTime, "myMacro", Schedule:=False
mNextTime = 0

End Sub

Sub myMacro()

''' do stuff
mCounter = mCounter + 1
Cells(mCounter, 1) = Format(mNextTime, "hh:mm:ss")
''' do stuff done

OnTimer

End Sub



 
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
macro not found, but its there Jim Conrady Excel Programming 1 November 10th 08 09:23 PM
macro not found, but it is there Jim Conrady Excel Programming 0 November 10th 08 09:17 PM
The macro ... cannot be found [email protected] Excel Programming 0 January 29th 07 11:51 PM
Macro cannot be found Barney Excel Discussion (Misc queries) 2 April 4th 06 01:21 PM
Macro cannot be found nenzax Excel Programming 5 February 7th 06 02:00 PM


All times are GMT +1. The time now is 08:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"