AOB
Registered User.
- Local time
- Today, 03:04
- Joined
- Sep 26, 2012
- Messages
- 637
Hi there,
I have a db with VBA code to connect and interact with EXTRA! Attachmate.
The code works perfectly fine when I run it on Windows XP, however when I try to run it on a Windows 7 machine, it fails to detect EXTRA! using the GetObject / CreateObject commands.
I removed the error handler and got the following error at the line in red :
I'm running Access2007 on both machines so the only thing I can think of might be that EXTRA! Attachmate is a 32-bit process while Windows 7 is 64-bit O/S.
Suggesting perhaps I need to identify "EXTRA.System" differently (does Windows7 need to be told Extra is 32-bit?)
Or am I barking up completely the wrong tree? Any suggestions?
Thanks in advance
AOB
I have a db with VBA code to connect and interact with EXTRA! Attachmate.
Code:
Option Compare Database
Option Explicit
Public ExtraSystem As Object
Public ExtraSession As Object
Public ExtraScreen As Object
Public Sub ConnectToEXTRA()
[INDENT]Dim strEDPFile As String
strEDPFile = CurrentProject.Path & "\" & Dir(CurrentProject.Path & "\*.edp")
[/INDENT][INDENT]' Check if Session already open
If Not ExtraScreen Is Nothing Then GoTo SessionOpen
On Error Resume Next
[COLOR=red]Set ExtraSystem = GetObject("", "EXTRA.System")[/COLOR]
If ExtraSystem Is Nothing Then GoTo CreateSystem
Set ExtraSession = ExtraSystem.Sessions(strEDPFile)
If ExtraSession Is Nothing Then GoTo CreateSession
Set ExtraScreen = ExtraSession.Screen
If ExtraScreen Is Nothing Then GoTo CreateScreen
[/INDENT]CreateSystem:
[INDENT]Set ExtraSystem = CreateObject("EXTRA.System")
[/INDENT][INDENT]If ExtraSystem Is Nothing Then
[INDENT]MsgBox "Could not create the EXTRA System object", vbCritical, "EXTRA System"
End
[/INDENT]End If
[/INDENT]CreateSession:
[INDENT]Set ExtraSession = ExtraSystem.Sessions.Open(strEDPFile)
[/INDENT][INDENT]If ExtraSession Is Nothing Then
[INDENT]MsgBox "Could not create the EXTRA Session object", vbCritical, "EXTRA Session"
End
[/INDENT]End If
[/INDENT]CreateScreen:
[INDENT]Set ExtraScreen = ExtraSession.Screen
[/INDENT]SessionOpen:
End Sub
The code works perfectly fine when I run it on Windows XP, however when I try to run it on a Windows 7 machine, it fails to detect EXTRA! using the GetObject / CreateObject commands.
I removed the error handler and got the following error at the line in red :
Run-time error 429
ActiveX component can't create object
I'm running Access2007 on both machines so the only thing I can think of might be that EXTRA! Attachmate is a 32-bit process while Windows 7 is 64-bit O/S.
Suggesting perhaps I need to identify "EXTRA.System" differently (does Windows7 need to be told Extra is 32-bit?)
Or am I barking up completely the wrong tree? Any suggestions?
Thanks in advance
AOB