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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can't create a session

Status
Not open for further replies.

drrocket5292

Technical User
Sep 6, 2005
73
0
0
US
I was able to get the attachmate type library and I now have a reference to it in Excel but now whenever I type in the code to call attachmate:

Public System As ExtraSystem
Public Sessions As ExtraSessions
Public Sess0 As ExtraSession
Public MyScn As ExtraScreen

Sub doesthiswork()

Set System = New ExtraSystem
Set Sessions = System.Sessions
Set Sess0 = System.ActiveSession
Set MyScn = Sess0.Screen

End Sub


I get an "object variable not set error" on MyScn because my sessions object = nothing. my systems object wokrs fine though so its just the sessions object that I'm having problems with. When I use the other code to try to call attachmate:

Public Sessions As Object
Public System As Object
Public Sess0 As Object

Sub pleasework()

'Extra Objects
Set System = CreateObject("EXTRA.System") ' Gets the system object
If (System Is Nothing) Then MsgBox "Could not create the EXTRA System object. Stopping macro playback.": Stop
Set Sessions = System.Sessions
If (Sessions Is Nothing) Then: MsgBox "Could not create the Sessions collection object. Stopping macro playback.": Stop
Set Sess0 = System.ActiveSession
If (Sess0 Is Nothing) Then MsgBox "Could not create the Session object. Stopping macro playback.": Stop

Set Sessions = Nothing
Set System = Nothing
Set Sess0 = Nothing

End Sub

i get a msgbox that says "could not create the sessions collections object" so once again my Sessions = nothing. Does anyone know why this would be? I'm logged into attachmate but can't seem to get excel to recognize the session.
 
Code:
Public System As Object
Public Sess0 As Object

Sub pleasework()
    Set System = CreateObject("EXTRA.System")
    If (System Is Nothing) Then MsgBox "Could not create the EXTRA System object.  Stopping macro playback.": Stop
    MsgBox System.FullName

    Set Sess0 = System.ActiveSession
    If (Sess0 Is Nothing) Then MsgBox "Could not create the Session object.  Stopping macro playback.": Stop
    MsgBox Sess0.FullName

    Set System = Nothing
    Set Sess0 = Nothing
End Sub

This will return the path and filename of your EXTRA executable. If this path and filename doesn't match the path and filename where EXTRA is installed on your system, then that's the problem.

If your EXTRA is fine, it'll return the path and filename of your session. If this path and filename doesn't match the path and filename for your session, then that's the problem.

If both of these look right, you may want to try reinstalling EXTRA. You've already had to replace the type library on your computer because it was missing. It's possible there are problems with the entire install and/or additional files missing.
 
If your only dealing with one session you may try

Public Screen As Object

Sub pleasework()
Set Screen = CreateObject("EXTRA.System").ActiveSession.screen
If (Screen Is Nothing) Then MsgBox "Could not create the EXTRA System object. Stopping macro playback.": Stop

Set Screen = Nothing
End Sub


[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
I'm just fishing here, mind you.

Where did you get the type library? Could it possibly be the wrong version for your version of Extra?

The code you post works perfectly on my Extra Enterprise 7.0 install from Access 2000. The potetial list of problem areas in my view:

* VBA not properly framing the request or not properly interpreting the reply
* The Type Library not properly interpreting the request, and/or not properly framing the reply
* The infamous, ubiquitous Interconnecting Wires -- i.e., Windows is doing something mysterious dependent on the price of gold, the length of women's skirts, and/or the phase of the moon.

My nickel's on the second one right now.
 
My bets on the third one. I've found that if you monkey around with these as you're trying to get it figured out things can get cross wired. In reality I can usually clear it by killing the Extra and/or the Excel processes in the Task Manager, but the easier way to make sure you're clean is a re-boot.

calculus
 
I've hit the same issue as calculus quite a few times. An end task or reboot will resolve the error because the program finally gives up referencing a session that's not there.
 
Actually, I've had that problem, too. A session won't completely die, and the next time I run my code appears to hang. I kill it in Task Manager and everything works fine. I guess I made the unwarranted assumption of a clean system. I also left out the potential problem area this falls under: the Extra system itself.

I didn't expect the Spanish Inquisition.
</python>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top