Printer error 482

Posted on 1998-09-27
Last Modified: 2010-10-29

Hi ,

I've got problems with HP printers...series 400, 500, 600 and 700.
Every time somebody with that kind of printer clicks the 'Print' command
in my program they get a runtime 482.

Unlike the descriptions in 'Help' my guess is that error 482 is a VB message
reporting a bad error code from the printer driver.
How can I trap this error? Can I bypass it an still be able to print?

There are no problems whatsoever with any other printers, but it's absolute
unacceptable my program can't be used by people who own a HP printer...

Ok, this is my print code:

Private Sub cmdPrintSelected_Click()

CommonDialog1.CancelError = True


'give the user a chance to halt the printjob
Dim msg As String
Dim X As Integer
msg = "You're about to print a full page sample of every font you selected. Continue?"
X = MsgBox(msg, 33, "Info")
If X = 2 Then    'do nothing
    'go ahead...
    CommonDialog1.DialogTitle = "Select a printer"
    CommonDialog1.Flags = &H100&
    '...and print
    Dim numitm
    Dim i As Integer
    numitm = listfonts.ListCount
    For i = 0 To numitm - 1
        If listfonts.Selected(i) Then
        'create left margin
        Printer.ScaleLeft = -500
        Printer.CurrentX = 0
        Printer.Print ""
        Printer.Print ""
        Printer.Font.Name = "Arial"
        Printer.Font.Size = 14
        Printer.Font.Bold = True
        Printer.Font.Italic = False
        Printer.Font.Underline = False
        Printer.Print "Sample of "; listfonts.List(i)
        Printer.Print ""
        Printer.Font.Size = 12
        Printer.Font.Italic = True
        Printer.Print "Size"
        Printer.Font.Name = listfonts.List(i)
        Printer.Font.Size = 6
        Printer.Font.Bold = False
        Printer.Font.Italic = False
        Printer.Print "6-point type, quite small, but readable for most people."
        Printer.Font.Size = 10
        Printer.Print "10-point type, often used for body text."
        Printer.Font.Size = 12
        Printer.Print "12-point type, easy-to-read-size."
        Printer.Font.Size = 14
        Printer.Print "14-point type, ideal for subheads."
        Printer.Font.Size = 18
        Printer.Print "18-point type is for emphasis."
        Printer.Font.Size = 24
        Printer.Print "24-point type makes headlines."
        Printer.Font.Size = 36
        Printer.Print "36-point type: impact."
        Printer.Font.Size = 60
        Printer.Print "60-point type!"
        Printer.Font.Name = "Arial"
        Printer.Font.Size = 12
        Printer.Font.Italic = True
        Printer.Font.Bold = True
        Printer.Print "Style"
        Printer.Font.Name = listfonts.List(i)
        Printer.Font.Bold = False
        Printer.Font.Italic = False
        Printer.Print "This is a normal weight type, suitable for most purposes."
        Printer.Font.Bold = True
        Printer.Print "This is a boldfaced type, ideal for emphasis or headings."
        Printer.Font.Bold = False
        Printer.Font.Italic = True
        Printer.Print "This is an italic (or oblique) type, used for emphasis."
        Printer.Font.Bold = True
        Printer.Print "This is a bold, italic type, combining both emphasis techniques."
        Printer.Font.Bold = False
        Printer.Font.Italic = False
        Printer.Font.Underline = True
        Printer.Print "This is a normal, underlined type."
        Printer.Font.Underline = False
        Printer.Print ""
        Printer.Font.Name = "Arial"
        Printer.Font.Size = 12
        Printer.Font.Italic = True
        Printer.Font.Bold = True
        Printer.Print "Characters"
        Printer.Font.Name = listfonts.List(i)
        Printer.Font.Size = 14
        Printer.Font.Bold = False
        Printer.Font.Italic = False
        Printer.Print "abcdefghijklmnopqrstuvwxyz"
        Dim char As String
        char = "²&é(§è!çà)-^$ùµ<,;:=³1234567890°_¨*%£>?./+|@#^{}[]´`\~"
        Printer.Print char
        Printer.EndDoc  'that's all
        End If

End If

Exit Sub
Select Case Err.Number
    Case 32755  'cancel error
    'do nothing
    Case Else   'anything else
    MsgBox "An Error was generated:" & vbCrLf & "Description: Error" & Str(Err.Number) & " - " & Err.Description & vbCrLf & vbCrLf & "Please inform the author with the error description above.", , "Error", Err.HelpFile, Err.HelpContext
End Select

End Sub

Thank you,

Question by:dvbasic
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 1436851
What version of VB? What line of Code do you get the error on?
LVL 12

Expert Comment

ID: 1436852
Error 482 is generic "printer error".  when does this pop up? What is status of printer? Does ANYTHING print? Have you single stepped thru this code?

Couple of general comments. Move the DIM CHAR out of the loop so it only runs once. Minimum font size is *8*, windows/VB has trouble rendering below 8 so that could be cause if program is stopping on or about that line. Put var name on Next (I know is not required but is cleaner)

I've found certain driver errors with the hp printer drivers, not relating to this problem, but with them rendering open circles and boxes as filled. Don't know it it's related or not.


Author Comment

ID: 1436853
Combining both answers:

I'm using VB5 (bought VB6 just now, not installed yet)

I' can't reproduce the error at my home. The errors were reported to me.
I can of coarse reproduce the error by a err.raise in VB, but I wouldn't know where, and how to still get the printing done...

I've got two descriptions of when the error occurs:
In one case, the print dialog comes up, and after setting how many copies and the print range, this user got no response from his printer (nothing happened).
Ater closing the program and open it again, the printer error 482 message came up.

In THAT code (at loading time) I merely do a :

For i = 0 To Printer.FontCount - 1      'get all printerfonts
    teller = i + 1
    formstart.lblCount = teller
    listfonts.AddItem Printer.Fonts(i)  'put each font into list box
Next i

In another case, the runtime occured right after clicking the OK button in the Print Dialog.
(Print dialog dissapears, runtime message pops up).

Hope this helps...


Accepted Solution

fguerreiro_inix earned 200 total points
ID: 1436854
Bypass the error.

If error is 482 and the printer is one of that kind, bypass it.
(but only in these conditions)

Hope this helps

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Visual Basic Excel Formatting error 4 141
Saving history changes to sub form 4 52
MS SQL store procedure to calculate and return result 6 68
MsgBox 4 71
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question