hello,
I'm trying to pass two Variant variables between two Subroutines, one that calls the other one, and am getting the error message
Run-time error '5':
Invalid procedure call or assignment
and the code stops on
AppActivate CablettersAppId
Now this code use to work before when I had it all contained within one Sub like this:
Can anyone help me to get it to work in a multi-subroutine/function setting?
thanks in advance,
david
I'm trying to pass two Variant variables between two Subroutines, one that calls the other one, and am getting the error message
Run-time error '5':
Invalid procedure call or assignment
and the code stops on
AppActivate CablettersAppId
Code:
Private Sub ForTestingPurposes_Click()
Dim CablettersAppId, CabcallsAppId As Variant
CablettersAppId = Shell("C:\Program Files\Anzio15\anzio32.exe", 1)
CabcallsAppId = Shell("D:\PROGRAM FILES\TELSTAR\TelStar.exe", 1)
Call CABCALLSandCABLETTERStestTelnet(CabletttersAppId, CabcallsAppId)
Status.Text = "end of test"
End Sub
Private Sub CABCALLSandCABLETTERStestTelnet(CablettersAppId, CabcallsAppId)
TimeDelay (7)
AppActivate CablettersAppId
VbSendKeys "robinson{ENTER}"
TimeDelay (2)
VbSendKeys "CAB{ENTER}"
TimeDelay (2)
VbSendKeys "DR75{ENTER}"
TimeDelay (2)
VbSendKeys "{ENTER}"
TimeDelay (60 * 5)
TimeDelay (7)
AppActivate CabcallsAppId
VbSendKeys "robinson{ENTER}"
TimeDelay (2)
VbSendKeys "ROPER{ENTER}"
TimeDelay (2)
VbSendKeys "DR75{ENTER}"
TimeDelay (2)
VbSendKeys "{ENTER}"
TimeDelay (2)
End Sub
Now this code use to work before when I had it all contained within one Sub like this:
Code:
Private Sub ForTestingPurposes_Click()
Dim CablettersAppId, CabcallsAppId As Variant
CablettersAppId = Shell("C:\Program Files\Anzio15\anzio32.exe", 1)
CabcallsAppId = Shell("D:\PROGRAM FILES\TELSTAR\TelStar.exe", 1)
TimeDelay (7)
AppActivate CablettersAppId
VbSendKeys "robinson{ENTER}"
TimeDelay (2)
VbSendKeys "CAB{ENTER}"
TimeDelay (2)
VbSendKeys "DR75{ENTER}"
TimeDelay (2)
VbSendKeys "{ENTER}"
TimeDelay (60 * 5)
TimeDelay (7)
AppActivate CabcallsAppId
VbSendKeys "robinson{ENTER}"
TimeDelay (2)
VbSendKeys "ROPER{ENTER}"
TimeDelay (2)
VbSendKeys "DR75{ENTER}"
TimeDelay (2)
VbSendKeys "{ENTER}"
TimeDelay (2)
Status.Text = "end of test"
End Sub
Can anyone help me to get it to work in a multi-subroutine/function setting?
thanks in advance,
david