CAn we pass an object as an argrument of a function that is declared in another unit.
like
Unit1:
'USEUNIT Unit2
Sub Task()
Set Obj = ............whatever here........
Call Validate(Obj)
End sub
Unit 2:
Function Validate(value)
Value.Click 'here I want to check properties for "value".... but getting errror "Object is required"
End Function
How can I pass object and use their properties in another unit. ?
Solved! Go to Solution.
When you get to the second function, you need to use something like eval() to tell it that what you passed isn't just a string. There's an example in here:
When you get to the second function, you need to use something like eval() to tell it that what you passed isn't just a string. There's an example in here:
Hi Kaiiii,
how about defining a variable of the object type on project level or project suite level, using that to store your object and as parameter for your function Validate.
Regards
S_Seydel
Hi,
The sceleton of your code looks correct.
Most probably, as the text of the error says, object is not assignrd to the Obj variable and thus the code in the Validate() function cannot access object's properties.
Hi
Thanks for your reply.
It's solved now. actually Object id gets chnaged after every execution so I used objectlabel property.
now it's working fine
Thanks @Marsha_R for your suggestion.. it's working.