Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 to open extra sessions

Status
Not open for further replies.

Remyaram

Programmer
Jun 4, 2018
6
IN
Hi,

I have a screen scrapping application which is in VB6, It is running on windows server 2003 and now we wanted to upgrade to windows server 2012 64 bit

I have a problem running the below code, it gives error- 432: File name or class name not found during Automation operation

GetObject("E:\Robots\Sessions\session" & "1" & ".edp")

I also tried specifying the class name

GetObject("E:\Robots\Sessions\session" & "1" & ".edp",extra.system)

Also tries CreateObject first and then GetObject, none of them sees to be working.

Thanks,
Remya

 
Here's what I've used...
Code:
'
    Set oSystem = CreateObject("Extra.System")
    
    If oSystem.Sessions.Count = 0 Then
        Set oSess = oSystem.Sessions.Open("C:\Program Files\E!PC\Sessions\Mainframe.edp")
    Else
        Set oSess = oSystem.ActiveSession
    End If

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Hi SkipVought,

thanks for your reply, I tried the same way, but oSess is coming out as Nothing even though the file exists on the location.

Though sessions.count is 1, sessions(0) returns nothing

thanks,
Remya
 
Please post your entire code.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Run time error 432, File name or class name not found during automation operation


First I tired like below and I get the error while invoking GetObject, though the file path is correct

Run time error 432, File name or class name not found during automation operation


Private Sub Command1_Click()
Dim system As Object
Dim extrasession As Object

Set system = CreateObject("Extra.System")

If system.Sessions.Count = 0 Then
Set extrasession = GetObject("E:\Robots\Sessions\session1.edp")

Else
Set extrasession = system.ActiveSession
End If
End Sub

Next I tried like below

Private Sub Command1_Click()
Dim system As Object
Dim extrasession As Object

Set system = CreateObject("Extra.System")

If system.Sessions.Count = 0 Then
Set extrasession = system.Sessions.Open("E:\Robots\Sessions\session1.edp")
extrasession.Visible = True

Else
Set extrasession = system.ActiveSession
extrasession.Visible = True
End If
End Sub

Here I am not getting any error, but extrasession is Nothing
system.Sessions.Count is returning 1, but if I take system.Sessions(0) or system.ActiveSession, it is set to Nothing
 
This is my code at the top of my Attachmate Module in Excel VBA. Notice that I have a reference set.
Code:
Option Explicit
'[b]you must have a reference set for Attachmate EXTRA! n.m Object Library
[/b]
Public oSystem As ExtraSystem
Public oSess As ExtraSession
Public oScrn As ExtraScreen
'...

Also is your emulator opening in any of these scenarios?

What happens if you manually open your emulator in a session and then run the code with a break? At that break, you could inspect the extrasession object in the Watch Window to discover wheter the full path name is as expected.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
I did add the reference and tried

Private Sub Command1_Click()
Dim sys As ExtraSystem
Dim sess As ExtraSession

Set sys = CreateObject("Extra.System")

If sys.Sessions.Count = 0 Then
Set sess = sys.Sessions.Open("E:\Robots\Sessions\session1.edp")
sess.Visible = True

Else
Set sess = sys.ActiveSession
sess.Visible = True
End If
End Sub

If there is a session opened manually, i can see sys.Sessions.Count is returning 1, but if I refer to sys.ActiveSession or sys.Sessions(0) , I get a NOTHING back
 
Open the Watch Window: View > Watch Window.

Right click in the WW and Add Watch.

In Expression enter sys and hit OK.

Put a BREAK on the two Set sess statements.

Run two tests: one with no session open and one with a session opened.

In both cases, observe the sys object in the WW. Open/expand the sys object to see the associated properties, particularly the Value for ActiveSession, Session.

Also look for a connection (Path) particularly to validate your connection (Path) string.

Thats the best I can offer at this time with no access to an Attachmate!Extra application.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Thanks for the screenshots.

I have no other thoughts other than trying this for the instance where a session was started manually...

Set sess = GetObject("Session1.EDP")

I’m really handicapped in that 1) I have no Attachmate!Extra application on my laptop and 2) its been many many years since I did anything signicant with programming an emulator. But this problem will percolate in my mind. 🤔

Please post back if you arrive at a solution. I am truly interested.



Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Hi,

I used write stuff for Extra years ago using VB6, so much so that I created a simple class that you can integrate into your code. I've attached the class, you may have to modify it but hopefully it may help you.

Its so long now ago I cant remember how to use the Class but it works.

Let me know how you get on

Steve

!ExtraDunce
 
 https://files.engineering.com/getfile.aspx?folder=1c4d1b35-cd73-449c-8d4c-f73ed58fc3e7&file=clsEasyExtra.cls
Thanks for this .

My problem is resolved after installing the latest version of attachmate extra. Earlier I was using attachmate extra 7.1 which did not work with all these options. But the same code is working with the latest version of attachmate.

Thank you for your replies SkipVought and SkipVought. Much appreciated :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top