Contact US

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!

*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

Attachmate Extra Printer Session Automation

Attachmate Extra Printer Session Automation

Attachmate Extra Printer Session Automation

Hi, I am trying to read the status of a printer session in order to automate downloading reports using Excel VBA.
I have been so far unsuccessful in retrieving the OIA (operator information) area or presentation space of a print session with OLE and ehlapi32.dll API to inquire if the session is "idle" (Finished downloading a report).
I want to capture the "Device busy" bit in Byte 90 of the OIA string so I my program will know when the printer session is not busy so I can send the next print job to the printer session.
Ideally, I would also like to capture the page count in a variable that is displayed in the printer session window as well to kept track of the number of pages printed.

My printer session connects via a SNA connection using LU3.
Any help would be greatly appreciated.

'My Excel VBA code
'Make a worksheet named "HLL_Test"

'- Declarations -
Private Declare Function HLLAPI Lib "C:\Program Files\Attachmate\E!E2K\ehlapi32.dll" (Func&, ByVal DataStr$, DataLgth&, Retc&) As Long

Sub HLL()
WkBkName_Prgm = ActiveWorkbook.Name
Set WksHLLTest = Workbooks(WkBkName_Prgm).Worksheets("HLL_Test")

'Connect to printer session "A"
Call HLLAPI(1, "A", 1, Retc)
WksHLLTest.Cells(1, 1).Value = Retc   'Display returned Code in excel sheet Cell A1

'Get OIA
DataLgth = 103
rc = 0
Call HLLAPI(13, DataStr, DataLgth, rc)

WksHLLTest.Cells(1, 2).Value = rc   'Display OIA returned Code in Excel sheet Cell A2
WksHLLTest.Cells(1, 3).Value = DataStr   'Display returned OIA data string in Cell A3

End Sub

Prepared by Attachmate Technical Support 104
Group 8: Input inhibited
This group consists of bytes 89 through 93 in the OIA data, and indicates why input
is inhibited in the current PS.
Byte# / Bit#  Description
Byte 1 (89)
0 Non–resettable machine check
1 Reserved for security key
2 Machine check
3 Communications check
4 Program check
5 Retry
6 Device not working
7 Device very busy
Byte 2 (90)
0 Device busy
1 Terminal wait
2 Minus symbol
3 Minus function
4 Too much entered
5 Not enough entered
6 Wrong number
7 Numeric field
Byte 3 (91)
0 Reserved
1 User not authorized
2 User not authorized (minus function)
3 Invalid dead key combination
4 Wrong place
5-7 Reserved
Byte 4 (92)
0 Message pending
1 Partition wait
2 System wait
3 Hardware mismatch
4 Logical terminal not configured at control unit
5-7 Reserved
Byte 5 (93)
0 Autokey inhibit
1 Application program has inhibited operator input
2-7 Reserved

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