ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Method 'ActivePrinter' of object '_Application' failed (https://www.excelbanter.com/excel-programming/274634-re-method-activeprinter-object-_application-failed.html)

kiat

Method 'ActivePrinter' of object '_Application' failed
 
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.


"Prabhu Dev" wrote in message
...
Sub PrintFax()
Dim Orginal_Printer As String

Orginal_Printer = Application.ActivePrinter

Application.ActivePrinter = "TOPCALL Fax"

ActiveSheet.PageSetup.PrintArea = "$b$24:$i$74"

With ActiveSheet.PageSetup
.Orientation = xlPortrait
End With

ActiveWindow.SelectedSheets.PrintOut Copies:=1

Application.ActivePrinter = Orginal_Printer

End Sub

In the above procedure(macro) executing the following line
Application.ActivePrinter = "TOPCALL Fax"
generates the
Run-time error '1004':
Method 'ActivePrinter' of object '_Application' failed

However printing the same region from the File menu
and the Print command works perfectly well. The fax doc
gets printed out on the fax machine.

Any help will be appreciated.

Prabhu





All times are GMT +1. The time now is 08:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com