Hi guys,
I've developed a macro in Excel 2007 to read/write to a pre-configured Attachmate session (the path for which is described by a string variable, stEDPFile). The macro is designed, on opening the workbook, to check if this session is already open, and if not, to open it :
It works perfectly fine on my machine, and on my colleague's also (we are both using Office 2007 and Attachmate v8.0)
However, when the end-users try to run it, the code does not automatically open the session (Office versions vary between 2003 and 2007, Attachmate appears to be v7.0 across the board)
It can create the system object fine, but when it tries to open the edp file [Set MySession = MySystem.Sessions.Open(stEDPFile)], it does nothing (i.e. on debugging, after this line, the object MySession is still 'Nothing')
I can probably arrange for them to get their Attachmate upgraded but given the simplicity of the code, I wouldn't have thought there would be any issue with using 7.0 as opposed to 8.0? Has anybody else come up against this problem?
Thanks in advance!
APMOB
I've developed a macro in Excel 2007 to read/write to a pre-configured Attachmate session (the path for which is described by a string variable, stEDPFile). The macro is designed, on opening the workbook, to check if this session is already open, and if not, to open it :
Code:
Global MySystem As Object
Global MySession As Object
Global MyScreen As Object
Private Sub Workbook_Open()
If MyScreen Is Nothing Then
On Error Resume Next
Set MySystem = GetObject("", "EXTRA.System")
If MySystem Is Nothing Then
Set MySystem = CreateObject("EXTRA.System")
If (MySystem Is Nothing) Then
Response = MsgBox("Could not create the EXTRA System object", vbCritical, "EXTRA System")
End
End If
End If
Set MySession = MySystem.Sessions(stEDPFile)
If MySession Is Nothing Then
Set MySession = MySystem.Sessions.Open(stEDPFile)
If MySession Is Nothing Then
Response = MsgBox("Could not create the EXTRA Session object", vbCritical, "EXTRA Session")
End
End If
End If
Set MyScreen = MySession.Screen
If MyScreen Is Nothing Then
Response = MsgBox("Could not create the EXTRA Screen object", vbCritical, "EXTRA Session")
End
End If
End If
End Sub
It works perfectly fine on my machine, and on my colleague's also (we are both using Office 2007 and Attachmate v8.0)
However, when the end-users try to run it, the code does not automatically open the session (Office versions vary between 2003 and 2007, Attachmate appears to be v7.0 across the board)
It can create the system object fine, but when it tries to open the edp file [Set MySession = MySystem.Sessions.Open(stEDPFile)], it does nothing (i.e. on debugging, after this line, the object MySession is still 'Nothing')
I can probably arrange for them to get their Attachmate upgraded but given the simplicity of the code, I wouldn't have thought there would be any issue with using 7.0 as opposed to 8.0? Has anybody else come up against this problem?
Thanks in advance!
APMOB