Excel printing macro problem

C

Cam

Hi, I just can't get this to work - I keep getting Runtime error 1004 ?
The aim is just to print to another printer called 'HP 1200 Tray 2'

Any tips would be great. Thanks.

*Sub Printer2()

Dim STDprinter As String
STDprinter = Application.ActivePrinter
Application.ActivePrinter = "HP 1200 Tray 2 on
HPBusinessInkjet1200:"
' change printer
ActiveSheet.PrintOut
' prints the active sheet
Application.ActivePrinter = STDprinter
' change back to standard printer
End Sub*
 
K

keepITcool

My guess:
excel doesnt use the 32bit portname but it's 16bit sibling.
e.g. MyPrinter on Ne01:

manually set the printer to the one you want.
type ?ActivePrinter in the immediate pane.
use that string in your code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top