Excel VBA找不到反射会话

时间:2019-02-22 21:34:23

标签: reflection

我使用以下代码将VBA连接到Attachmate Reflection会话。我可以正常连接,但是我的同事具有间歇性的连接能力。有时候它有用,有时却不适合他们。我在库中有所有四个正确的Attachmate_Reflection_Object引用。

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

0 个答案:

没有答案