Forum Discussion
alinder
13 years agoContributor
You can only use object variables with much reliability when the object you are trying to assign exists onscreen.
For a parameterized routine like you are considering, it is helpful to think of the problem as not how to pass in the object, but how to pass in how to find the object.
For the simple case of using Aliases, if you pass the alias in as a String, when the combo box is on screen you can then:
a) use a series of WaitAliasChild calls to get the object
b) use "Eval" to blindly execute the alias to get the object
c) use a Find with the alias name and the MappedName property (this is slow)
For a parameterized routine like you are considering, it is helpful to think of the problem as not how to pass in the object, but how to pass in how to find the object.
For the simple case of using Aliases, if you pass the alias in as a String, when the combo box is on screen you can then:
a) use a series of WaitAliasChild calls to get the object
b) use "Eval" to blindly execute the alias to get the object
c) use a Find with the alias name and the MappedName property (this is slow)