Folks,
I'm a VBScripting newbie and have a very simple question.
I'm trying connect to a COM Object as follows:
However, I receive this error:
I assume this error means that I'm not returning the objFarm object correctly. Could anyone inform me of the correct way to let functions return objects in vbscript please?
Thanks in advance for your help.
James.
I'm a VBScripting newbie and have a very simple question.
I'm trying connect to a COM Object as follows:
Code:
'Global Vars
dim objFarm
'Create Farm Object
objFarm = ConnectFarm()
Function ConnectFarm( )
Dim objFarm
' Create MetaFrameFarm object
Set objFarm = CreateObject("MetaFrameCOM.MetaFrameFarm")
'[...]Error Checking code[...]
'return object [line58]
return objFarm
End Function
Code:
C:\CtxAppSecurity.wsf(58, 14) Microsoft VBScript runtime error: Type mismatch: 'return'
I assume this error means that I'm not returning the objFarm object correctly. Could anyone inform me of the correct way to let functions return objects in vbscript please?
Thanks in advance for your help.
James.