ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Printing to Adobe without getting promt for name (https://www.excelbanter.com/excel-programming/280788-printing-adobe-without-getting-promt-name.html)

Danny McCarthy

Printing to Adobe without getting promt for name
 
I am trying to print an excel spreadsheet to adobe without getting a
prompt for the filename. I am getting the runtime error '1004'
"Method 'PrintOut' of object 'sheets' failed"

Can anyone help me?

Sheets(Array("Front Sheet", "Sales", "MP")).Select
Sheets("Front Sheet").Activate
ActiveWindow.SelectedSheets.PrintOut _
Copies:=1, _
ActivePrinter:="Acrobat PDFWriter on LPT1:", _
PrintToFile:=True, _
PrToFilename:="C:\temp\Week 43.pdf"

Dick Kusleika[_3_]

Printing to Adobe without getting promt for name
 
Danny

See here

http://www.google.com/groups?threadm...GP10. phx.gbl

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Danny McCarthy" wrote in message
om...
I am trying to print an excel spreadsheet to adobe without getting a
prompt for the filename. I am getting the runtime error '1004'
"Method 'PrintOut' of object 'sheets' failed"

Can anyone help me?

Sheets(Array("Front Sheet", "Sales", "MP")).Select
Sheets("Front Sheet").Activate
ActiveWindow.SelectedSheets.PrintOut _
Copies:=1, _
ActivePrinter:="Acrobat PDFWriter on LPT1:", _
PrintToFile:=True, _
PrToFilename:="C:\temp\Week 43.pdf"





All times are GMT +1. The time now is 05:28 PM.

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