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

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,871
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
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,871
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,827
Messages
5,855,877
Members
431,771
Latest member
CoryMelth

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
Top