PrintObject not printing - what am I missing?

ColinCoady

New Member
Joined
Mar 21, 2019
Messages
35
I can't figure out why this code won't print a PDF object ("AcroExch.Document.DC","") I have on a sheet.
I stuck the sh.select just to see if the macro passed the PrintObject line . Only had 1 PDF object on the sheet for testing.
No errors come up but nothing prints.
Any ideas why?
-Colin


Code:
Sub PrintAll()
'
' PrintAll Macro
' Prints all objects on sheet named Docs
'
Dim sh As Shape


Sheets("Docs").Select
    For Each sh In ActiveSheet.Shapes
    sh.ControlFormat.PrintObject = msoTrue
    sh.Select
    Next sh


End Sub
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
This is not a Print command
It is a property that determines whether or not the object will be printed with the rest of the sheet contents
 
Last edited:
Upvote 0
Ha ha Thanks for clearing that up. I'm new at this. Can you tell?

Is there any way a macro can print whatever objects are on the sheet. They are usually pdf.
Any code to pick one doc , open associated program, print it, close and then open next to print. And so on.

Never know the number of docs on the sheet but never more than 10.

Thanks
for any help.
-Colin
 
Upvote 0
Make use of the macro recorder - it will capture some manual operations. Then try adapt the recorded code to your need.
We'll try to help fill in the blanks.
 
Upvote 0

Forum statistics

Threads
1,214,942
Messages
6,122,367
Members
449,080
Latest member
Armadillos

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