View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Greg Lovern Greg Lovern is offline
external usenet poster
 
Posts: 224
Default OnTime: Pass Object Arguments

You mean just pass the value of the combobox? I don't want to do that.
If all I wanted was the value of the combobox, I'd just pass that
value.

What I'm doing now is passing strings that can be used to identify the
objects, such as range addresses, combobox names, worksheet names,
etc., then rebuilding the objects from those strings in the function
that is called by OnTime.

It works, but it would be nice if there was a more direct way.

Greg


On Oct 11, 9:47 am, Mike wrote:
Maybe like this
UserForm1.ComboBox1.Vaule

"Greg Lovern" wrote:
I understand how to pass number and string arguments with OnTime. But
what about object arguments? Can I pass a range object, combobox
object, etc.?


Here's how I'm passing number and string arguments. How do I pass
object arguments?


Function tester1()
Const NUM_ARG As Long = 5
Const STRING_ARG As String = "String"


Debug.Print "tester1: " & NUM_ARG & ", " & STRING_ARG & ", " & Now
Application.OnTime Now + 0.0000001, "'tester2 " & NUM_ARG & ", """
& STRING_ARG & """'"
End Function


Function tester2(NUM_ARG, STRING_ARG)
Debug.Print "tester2: " & NUM_ARG & ", " & STRING_ARG & ", " & Now
Debug.Print
End Function


Thanks,


Greg