-
-
Try this, notice the use of single quotes
[vba]Sub Testme()
Dim xl As Excel.Application
Dim Str As String
Set xl = Excel.Application
Str = "hey"
xl.OnTime Now + TimeValue("00:00:01"), "'test " & """" & Str & """'"
End Sub[/vba]
-
-
Yeah, Andy, why is that??
If there were no argument involved, then you would write "test".
Sid
-
An educated guess, as I have not seen a definitive statement, would be that the single quotes act a little like the single quotes used when a sheet name reference contains spaces and keeps the information together.
The double quotes imply the argument is of type String.
-
-
It was one of the few questions I posted in the ms newsgroups, which was quickly answered by John Green.
-
-
Yeah, Andy, excellent "guess". It makes a lot of sense, and I gotta admit I never would have thought of it.
-
Hi folks, I am trying to implement a similar piece of code and I am just running into a hell of a time with it.
The code I am trying to use to call the procedure Picture_Update is as follows:
Application.OnTime EarliestTime:=TimeValue("16:53:45"), Procedure:="'Scheduler.Picture_Update picCount, arNames()'", Schedule:=True
The sub I want to run looks like this. I keep getting a Macro-not found error when the time comes around. Can anyone tell me what I am doing wrong? I think it has something to do with how I am trying to pass the variables.
Public Sub Picture_Update(picCount, ByRef arNames() As String)
With BOARD_DISPLAY.IMAGES
Picture_Path = ("C:\PICTURES_STREAM\" & arNames(picCount))
.Picture = LoadPicture(Picture_Path)
BOARD_DISPLAY.Repaint
If Cancel Then Exit Sub
picCount = picCount + 1
End With
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules