×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

VB6 to open extra sessions

VB6 to open extra sessions

VB6 to open extra sessions

(OP)
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

RE: VB6 to open extra sessions

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,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: VB6 to open extra sessions

(OP)
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

RE: VB6 to open extra sessions

Please post your entire code.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: VB6 to open extra sessions

(OP)
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

RE: VB6 to open extra sessions

This is my code at the top of my Attachmate Module in Excel VBA. Notice that I have a reference set.

CODE

Option Explicit
'you must have a reference set for Attachmate EXTRA! n.m Object Library

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,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: VB6 to open extra sessions

(OP)
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

RE: VB6 to open extra sessions

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,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: VB6 to open extra sessions

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")
http://docs.attachmate.com/extra/x-treme/apis/com/...

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,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: VB6 to open extra sessions

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

RE: VB6 to open extra sessions

(OP)
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 :)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close