CreateObject fails in Windows 7 (Access2007)

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.

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
 
Hi there,

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 :



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


Sorry To revive This old thread but did you ever found out what the issue was? im kinda having he same issue, I could get it where the VBA code doesnt give me any error but EXTRA is not doing anything, it always comes back as NO RECORDS FOUND


Thanks
 
Hello there - no problem!

I believe it was as I originally suspected, that being the conflict between the 32-bit application running in a 64-bit O/S, and subsequent issues with the registry keys

The way I got around it was to use Attachmate Reflection rather than Attachmate EXTRA! - I believe Attachmate retired EXTRA! post-Win7 and moved to Reflection instead?

The object calls are still the same (Windows still refers to it as "EXTRA.System") so the code doesn't change, just the installed emulator engine.

But to be honest, it's been quite a while since I visited this database so I can't remember if there was more to it than just that.

Suggest you look into Reflection as an alternative / upgrade and see if that works for you?
 
Hello there - no problem!

I believe it was as I originally suspected, that being the conflict between the 32-bit application running in a 64-bit O/S, and subsequent issues with the registry keys

The way I got around it was to use Attachmate Reflection rather than Attachmate EXTRA! - I believe Attachmate retired EXTRA! post-Win7 and moved to Reflection instead?

The object calls are still the same (Windows still refers to it as "EXTRA.System") so the code doesn't change, just the installed emulator engine.

But to be honest, it's been quite a while since I visited this database so I can't remember if there was more to it than just that.

Suggest you look into Reflection as an alternative / upgrade and see if that works for you?


Thanks But i Think i found a way to do it, I believe the way that Extra understand Access has changed for example:

Before the keys were actioned like this (when Extra didnt do anything) :

.TransmitTerminalKey rcIBMTabKey

Now they are actioned like this (like this i can actually see Extra Doing whats being asked):


Sess0.Screen.SendKeys ("<Tab>")

now i will have to figure out what is what and replace eerrrthing here, But hey at least im making progress.

Im already Stuck on what to replace

Do While .getdisplaytext(24, 7, 1) <> "E"


.getDisplaytext wont work... do you have an idea on what i could replace it with?

Thanks
 
I presume that Do While loop is within a With / End With block?

Code:
With Sess0.Screen
    Do While .GetDisplayText(24, 7, 1) <> "E"
        ...
    Loop
End With

If so, try .Area instead?

.Area takes 4 arguments, namely 2 sets of X and Y co-ordinates on the screen defining the area of the screen you want to retrieve the text from (X1, Y1, X2, Y2)

Code:
Sess0.Screen.Area(5, 10, 5, 20)

...would therefore return the text on line 5, from 'position' 10 to 'position' 20 looking left-to-right, for example
 
I presume that Do While loop is within a With / End With block?

Code:
With Sess0.Screen
    Do While .GetDisplayText(24, 7, 1) <> "E"
        ...
    Loop
End With

If so, try .Area instead?

.Area takes 4 arguments, namely 2 sets of X and Y co-ordinates on the screen defining the area of the screen you want to retrieve the text from (X1, Y1, X2, Y2)

Code:
Sess0.Screen.Area(5, 10, 5, 20)

...would therefore return the text on line 5, from 'position' 10 to 'position' 20 looking left-to-right, for example

Ended Up using Sess0.Screen.GetString (X,Y,Z) worked now to gifure the rest out lol, One line at a time..
Thanks
 
Yeah it's fun alright! Best o' luck!
 

Users who are viewing this thread

Back
Top Bottom