Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default OnTimer - The macro 'macro name' cannot be found.

hi
i just tested your code on xl03. worked perfectly.
where do you have the MyMacro macro?

regards
FSt1

"louieuow" wrote:

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default OnTimer - The macro 'macro name' cannot be found.

Is all your code in the same module as the module level variables declared
as Private

Are you sure another macro named "myMacro" does not exist in the same
project or even in any other open project.

Try fully qualifying, change in the OnTime calls

"myMacro"
to
ThisWorkbook.Name & "!Module1.myMacro"

Regards,
Peter T

"louieuow" wrote in message
...
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





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
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 11:50 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"