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
 

Some videos you may like

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,343
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:

ColinCoady

New Member
Joined
Mar 21, 2019
Messages
35
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
 

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,343
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,108,810
Messages
5,525,010
Members
409,615
Latest member
papaluigi94

This Week's Hot Topics

Top