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

Excel Macro can't recognise attachmate 7.5 session

Status
Not open for further replies.

prossa

Technical User
Oct 31, 2004
2
AU
Hi All,
I am having trouble with an old excel 97 macro running on attachmate 7.5, the macro is designed to paste data into a host 3270 session.
I have the following global constant setup
Global Const ST_3270_32 = "A" ' IBM 3270 - 32 bit INFOConnect
And here's the code whre it fails:

Public Sub GetUserName()


Username = "C:\Program Files\Attachmate\INFOCNEE\sessions\enu\3270-FLARE.IDP"

ApiFunc = PROFILEASSOCIATE
ApiString = "A" + Username 'Associate file to Session A
ApiRetc = WHLLOK

Call HllFunction

If ApiRetc <> WHLLOK Then
MsgBox "Assign Session A Failed - Please Contact the Finance Help Desk . Error Code = " & ApiRetc, 0, "Error"
End If

I get an error :assign session a failed, error code= 1
Error code 1 is defined as any of the ones below.

Global Const WHLLNOTCONNECTED = 1 'Not Connected To Presentation Space.
Global Const WHLLBLOCKNOTAVAIL = 1 'Requested size is not available.

Global Const CONNECTPS = 1 'Connect Presentation Space.

I can see the attachmate sessions runing and the global perferances are set to the correct hllapi shortname "A".

Any ideas ?

Thanks for your help.


 
I have managed to get excel to recognsie the session by commenting out the old code on sessions. Now excel fails with g-_api.dll error. Does anyone know how to register this dll under windows xp sp1/excel2003 ? I have simply copied the file to c:\windows\system32 folder so the macro works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top