Print Sheets Individually

Gregory72

New Member
Joined
Jun 25, 2014
Messages
12
I get this error:

Run-time error '1004':
Method 'PrintOut' of object '_Worksheet' failed



When I run this code:

Dim printSheet As Worksheet
For Each printSheet In ActiveWorkbook.Sheets
printSheet.PrintOut
Next printSheet




And it is driving me crazy. All I want to do is print each sheet individually.

Does anyone know possible reason for why it isn't working?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
There are hidden sheets in the workbook, but I'm only wanting to print the sheets that are visible.
 
Upvote 0
Try

Code:
Dim printSheet As Worksheet
For Each printSheet In ActiveWorkbook.Sheets
    If printSheet.Visible = xlSheetVisible Then printSheet.PrintOut
Next printSheet
 
Upvote 0
Thanks VoG,
It works fine now. Originally, I used an If statement to filter through the visible sheets before the For loop to print all of the sheets. I thought that the .PrintOut function would have just assumed to print the visible sheets similar to how the ActiveWorkbook.PrintOut makes this assumption. It doesn't, apparently.
Thanks again!
 
Upvote 0

Forum statistics

Threads
1,215,472
Messages
6,125,004
Members
449,203
Latest member
Daymo66

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