PDA

View Full Version : 1004 error



aoc
04-07-2007, 03:08 PM
hi,

when I run the code below I get

1004 error " Method 'ActivePrinter' of object '_Application' failed "

?zerindeki is the turkish of on

Sub ece()
Application.ActivePrinter = "Ne02: ?zerindeki HP DeskJet 840C/841C/842C/843C "
ActiveWindow.SelectedSheets.PrintOut Copies:=1
End Sub

what is the problem ?

austenr
04-07-2007, 03:32 PM
Err 1004 means the printer you specified doesn't exist. Try a one line macro
debug.print application.activeprinter after you manually set your printer of
choice to get the exact printer name. :hi:

mdmackillop
04-07-2007, 03:34 PM
Try Application.ActivePrinter = "?zerindeki HP DeskJet 840C/841C/842C/843C on Ne02:"

Have a look at this KB Item (http://vbaexpress.com/kb/getarticle.php?kb_id=528)