gmaxey
10-03-2013, 09:50 AM
I am trying to call a procedure that take arguments using Application.OnTime.
I'm almost positive that I've had success with this before, but now I simply can't get it to work. I'm trying to use the syntax outlined here: http://www.markrowlinson.co.uk/articles.php?id=10
In a standard module I have this code to run tests. Tests 1-3 run fine (the called procedures don't take arguments). However, with Test 4-5 nothing happens.
I'm sitting here surrounded with piles of hair and bloody scalp! What am I missing/doing wrong? Thanks
Option Explicit
Sub Test1()
Application.OnTime When:=Now + 0.000005, Name:="Testing1"
End Sub
Sub Test2()
Application.OnTime When:=Now + 0.000005, Name:="modMain.Testing2"
End Sub
Sub Test3()
Application.OnTime When:=Now + 0.000005, Name:="Project.modMain.Testing3"
End Sub
Sub Test4()
Application.OnTime When:=Now + 0.000005, Name:="'Testing4 ""Test 4""'"
End Sub
Sub Test5()
Application.OnTime When:=Now + 0.000005, Name:="'modMain.Testing4 ""Test 4""'"
End Sub
Sub Test6()
Application.OnTime When:=Now + 0.000005, Name:="'Project.modMain.Testing4 ""Test 4""'"
End Sub
In another standard module named modMain, I have these procedures:
Option Explicit
Sub Testing1()
MsgBox "Test 1"
End Sub
Sub Testing2()
MsgBox "Test 2"
End Sub
Sub Testing3()
MsgBox "Test 3"
End Sub
Sub Testing4(strTest As String)
MsgBox strTest
End Sub
I'm almost positive that I've had success with this before, but now I simply can't get it to work. I'm trying to use the syntax outlined here: http://www.markrowlinson.co.uk/articles.php?id=10
In a standard module I have this code to run tests. Tests 1-3 run fine (the called procedures don't take arguments). However, with Test 4-5 nothing happens.
I'm sitting here surrounded with piles of hair and bloody scalp! What am I missing/doing wrong? Thanks
Option Explicit
Sub Test1()
Application.OnTime When:=Now + 0.000005, Name:="Testing1"
End Sub
Sub Test2()
Application.OnTime When:=Now + 0.000005, Name:="modMain.Testing2"
End Sub
Sub Test3()
Application.OnTime When:=Now + 0.000005, Name:="Project.modMain.Testing3"
End Sub
Sub Test4()
Application.OnTime When:=Now + 0.000005, Name:="'Testing4 ""Test 4""'"
End Sub
Sub Test5()
Application.OnTime When:=Now + 0.000005, Name:="'modMain.Testing4 ""Test 4""'"
End Sub
Sub Test6()
Application.OnTime When:=Now + 0.000005, Name:="'Project.modMain.Testing4 ""Test 4""'"
End Sub
In another standard module named modMain, I have these procedures:
Option Explicit
Sub Testing1()
MsgBox "Test 1"
End Sub
Sub Testing2()
MsgBox "Test 2"
End Sub
Sub Testing3()
MsgBox "Test 3"
End Sub
Sub Testing4(strTest As String)
MsgBox strTest
End Sub