Results 1 to 6 of 6

Thread: Runtime Error 482 Printer Error

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2006
    Location
    London, UK
    Posts
    817

    Runtime Error 482 Printer Error

    I get a “Runtime Error 482 Printer Error” when I try to print to a colour printer I don’t get it when I print to a PDF spooler or another black and white printer.
    The colour printer is working, does have paper and I can print to it from other applications.
    Any reasons why this is and is there a way I can be sure my application can print to any printer that is attached to the computer?

  2. #2

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Runtime Error 482 Printer Error

    Anything different about the code you are using for this printer as opposed to the others?

    If you go outside your application can you print to the color printer?

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2006
    Location
    London, UK
    Posts
    817

    Re: Runtime Error 482 Printer Error

    I've just done a test trying to send "Hello" to the colour printer using this code and I get the same error. And yep, the printer prints using all other applications.
    Note I use this newer printdlg as for some reason the defaut one stalls for 10 seconds before printing. http://support.microsoft.com/kb/322710

    vb Code:
    1. Private Sub Form_Load()
    2. Dim printDlg As PrinterDlg
    3. Dim NewPrinterName As String
    4. Dim objPrinter As Printer
    5. Dim strsetting As String
    6. Set printDlg = New PrinterDlg
    7.     ' Set the starting information for the dialog box based on the current
    8.     ' printer settings.
    9.     printDlg.PrinterName = Printer.DeviceName
    10.     printDlg.DriverName = Printer.DriverName
    11.     printDlg.Port = Printer.Port
    12.     ' Set the default PaperBin so that a valid value is returned even
    13.     ' in the Cancel case.
    14.     printDlg.PaperBin = Printer.PaperBin
    15.     If Not printDlg.ShowPrinter(Me.hWnd) Then
    16.         Debug.Print "Cancel Selected"
    17.         Exit Sub
    18.     End If
    19.     ' Locate the printer that the user selected in the Printers collection.
    20.     NewPrinterName = UCase$(printDlg.PrinterName)
    21.     If Printer.DeviceName <> NewPrinterName Then
    22.         For Each objPrinter In Printers
    23.            If UCase$(objPrinter.DeviceName) = NewPrinterName Then
    24.                 Set Printer = objPrinter
    25.            End If
    26.         Next
    27.     End If
    28.     Printer.Print "hello"
    29. End Sub

  5. #5
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Runtime Error 482 Printer Error

    Since you're not using any standard functionality I wouldn't know what to suggest.
    I personally try to stay away from any third party controls or dll regardless who's the vendor unless it's something absolutely necessary.

    Sorry for not being helpfull.

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2006
    Location
    London, UK
    Posts
    817

    Re: Runtime Error 482 Printer Error

    I have a strange problem with using the commondialog.showprinter. It stalls for an annoyingly long time before the document appears in the print queue.
    Roughly 10 seconds. I'm using the Microsoft Common Dialog Control 6.0(SP6) and it does it even using this code. Is there anything that I can do?

    vb Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.     CommonDialog1.ShowPrinter
    5.     Printer.Print "Hello"
    6.     Printer.EndDoc
    7. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width