Print to PDF Macro error 1004

a_gunslinger

New Member
Joined
Jul 28, 2011
Messages
8
Created a basic time saving macro assigned to Personal.xlbs that prints spreasheets I receive in emails to PDF. But I cant get the print to PDf function to work, not lieking the printer name I think.

Open a target spreadsheet.
Developer > Record Macro >
Give it a name and Shortcut Key
Store in > Personal.xlbs
Record Macro: File > Print > Printer = Adobe PDF > Print All Pages > Print > Choose filename and target save location
Stop Recording

Recording the Macro steps works and it prints. But When running th macro it hags with:


Run-time error 1004: Method 'ActivePrinter of object "_Application' failed.

Used all combinations of Adobe Printer names:

Sub SchedulesPDF()
'
' SchedulesPDF Macro
'
' Keyboard Shortcut: Ctrl+q
'
Application.ActivePrinter = "Adobe PDF Converter"
ActiveWorkbook.PrintOut 'Copies:=1, Collate:=True, IgnorePrintAreas:=False
End Sub



Any guideance appreciated ;^)
<!-- / message --><!-- BEGIN TEMPLATE: ad_showthread_firstpost_sig --><!-- END TEMPLATE: ad_showthread_firstpost_sig -->
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Created a basic time saving macro assigned to Personal.xlbs that prints spreasheets I receive in emails to PDF. But I cant get the print to PDf function to work, not lieking the printer name I think.

Open a target spreadsheet.
Developer > Record Macro >
Give it a name and Shortcut Key
Store in > Personal.xlbs
Record Macro: File > Print > Printer = Adobe PDF > Print All Pages > Print > Choose filename and target save location
Stop Recording

Recording the Macro steps works and it prints. But When running th macro it hags with:

Run-time error 1004: Method 'ActivePrinter of object "_Application' failed.

Used all combinations of Adobe Printer names:

Sub SchedulesPDF()
'
' SchedulesPDF Macro
'
' Keyboard Shortcut: Ctrl+q
'
Application.ActivePrinter = "Adobe PDF Converter"
ActiveWorkbook.PrintOut 'Copies:=1, Collate:=True, IgnorePrintAreas:=False
End Sub


Any guideance appreciated ;^) <!-- / message --><!-- BEGIN TEMPLATE: ad_showthread_firstpost_sig --><!-- END TEMPLATE: ad_showthread_firstpost_sig -->


not to sure but i think you need the network port of said printer (Ne00 or Ne06) or is this simply a print to file thing?
 
Upvote 0

Forum statistics

Threads
1,224,534
Messages
6,179,390
Members
452,909
Latest member
VickiS

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top