vendredi 22 février 2019

Excel VBA cannot find Reflection Session

I use the below code to connect my VBA to an Attachmate Reflection Session. I am able to connect no problem but my coworkers have intermittent connection abilities. Sometimes it works and sometimes it doesn't for them. I have all four of the correct Attachmate_Reflection_Object references in the library.

Private Function ATLASRGO(MySpleen As Object)
Dim Sys As Object, Sess As Object
Dim MyBridge As Object
Set Sys = CreateObject("EXTRA.System")


MsgBox ("Make sure your ATLAS session is active and logged into the =4.5 screen and then click 'OK' to continue.")

'sets current sesion to most recently active session
Set Sess = Sys.ActiveSession
'if no recent session found then msgbox and exit
If (Sess Is Nothing) Then
    MsgBox "Could not locate the required ATLAS session.  Open an ATLAS session and login to the neccessary function."
    Exit Function
Else
    Set MySpleen = Sess.Screen
End If

'if session found, activates session
    Sess.Activate

End Function



Sub ATLASApprovals()

Dim MyScreen As Object

Call ATLASRGO(MyScreen)
 '''' code for the macro to run here is proprietary
End Sub





Aucun commentaire:

Enregistrer un commentaire