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

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
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,553
Messages
6,120,176
Members
448,948
Latest member
spamiki

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