How to call a VBScript method from another object

I have a Sub method in my main object. Is there a way to call this method from another child object? Or do I have to copy and paste it into the child's script editor?


Thanks, Dave

2,229 views 3 replies
Reply #2 Top
Prefix the sub you want to call with Public. Like: Public Sub myLittleSub
Then call it from another script by using DesktopX.ScriptObject("nameOfObject").myLittleSub

I'm not sure if you need to prefix Public to your sub, but to be sure...
Reply #3 Top
Thanks thomassen, that's exactly what I needed. Although you do not need the "Public" as VBScript Sub routines are Public by default.