View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Application.OnTime -- Unable to Pass Macro with Numeric Parameter

don't pass a byte. Change your function to expect an integer or a long.

--
Regards,
Tom Ogilvy

"Butaambala" wrote in message
oups.com...
I am having trouble with Application.OnTime when specifying a Macro
with Numeric (Byte) parameter. Here is the code:

macro I'm calling:
Public Sub mcrExtractIntraData(bteIntraday As Byte)

Failed attempts:
1)
NextIntradayTime = Now + TimeValue("00:01:00")
strProc = "mcrExtractIntraData" & " 1"
Application.OnTime NextIntradayTime, strProc

2)
NextIntradayTime = Now + TimeValue("00:01:00")
Application.OnTime NextIntradayTime, "mcrExtractIntraData " & 1

3)
NextIntradayTime = Now + TimeValue("00:01:00")
Application.OnTime NextIntradayTime, "'mcrExtractIntraData 1'"

Any help greatly appreciated.