How to call Class inside 1 more Class and use it in Automation script
Class 1
On Error Resume Next
ExecuteFile "C:\Arun\testing.class"
if Err.Number <> 0 then
Reporter.ReportEvent micFail,"AccountAllocation.class", Err.Description
end if
Err.Clear
Class Main
private objTesting
private sub Class_Initialize()
objTesting=null
End Sub
public function getTestingReference
Set objTesting = New Testing
set getTestingReference= objTesting
end function
'Set objTesting = New Testing
'Call objTesting.add1
End Class
Class 2
Class Testing
Private a
Private Sub Class_Initialize()
a=null
end Sub
Public function Add1()
msgbox "inside"
End function
End Class
Script
'On Error Resume Next
ExecuteFile "C:\Arun\main.class"
if Err.Number <> 0 then
Reporter.ReportEvent micFail,"AccountAllocation.class", Err.Description
end if
Err.Clear
'private objTesting
' set getTestingReference = objTesting
Set objMain = New Main
'Call objTesting.add1
Set objTesting=objMain.getTestingReference
objTesting.add1
1 comment:
Hi,
This website is great helpful for me.
Thanks
Prasad Gali
Post a Comment