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!

Closing an Attachmate Session (OLE) 1

Status
Not open for further replies.

rosenk

Programmer
Jan 16, 2003
403
0
0
I've tried several different ways to close a session, but the only one that I can get to work is unreasonable. (In particular, System.Quit -- this is unreasonable because it closes ALL sessions, not just the one I want to close.)

Here's a trimmed down example of one of the things I've tried:

Code:
Set System = CreateObject("EXTRA.System")
Set Sessions = System.Sessions
Set Sess0 = Sessions.Item(SessionName)
Sess0.Close

Sess0 is definitely a reference to the session that I want to close at the point that I get to the Sess0.Close call. I've verified this by doing
Code:
Sess0.Visible = 0

I've also tried calling
Code:
Sess0.CloseEx 9
and variations including making sure the session is visible, making sure it's not visible, making sure it's connected and/or not connected. All combinations of these, basically.

Any ideas on how I can make sure the session closes?

Thanks.
 
I was certainly expecting it to work for me, too. Not sure if it makes a difference, but this is a telnet session specifically.
 
I have not had to much luck with the built in EB, I particularly like using VB, here is what I did:

Public Sub cmdCloseXXX_Click()

Set System = CreateObject("EXTRA.System")
Set Sessions = System.Sessions
Set XXX = Sessions.Open("C:\Session Location on hardrive")
xxx.close

This seems to work especially well for me..... Dont forget to dim your variable as object in the general declarations like this:

Dim System As Object
Dim Sessions As Object
Dim QPads As Object
Dim QPad As Object

Dim XXX As Object
 
Speaking of closing the sessions.

I've got two sessions running. Let's say Sess0 and Sess1.

I can close Sess1 easily but Sess0 keeps poping up a box that says :

boo5.jpg


I can't close it until the "Macro running" in the bottom right hand corner goes away.

Anyone know how to get rid of that or get around it?
 
Stop the macro.

You can use the Shell function to run "EBRun" and the macro name. This will hopefully not give you the error.

Under normal circumstances I don't think you'll be able to close a session that a macro is running in.

calculus
 
Thanks was it!

"C:\Program Files\e!pc\Ebrun.exe" "C:\Program Files\e!pc\Macros\XXXXXXXXXXX.ebm"

Thanks Calculus!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top