Exporting a SmartArt graphic

pbassett

Active Member
Joined
May 5, 2004
Messages
358
I dynamically generate Org Charts using the SmartArt CirclePictureHierarchy object, but I am unable to export them as PDF files in code.
I thought I could use the same code as I use to export a Chart, but that didn't work.
I believe exporting Shapes is doable, but I can't capture the code in a macro when I select Design->Convert to Shapes.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
19,494
The SmartArt is a shape, so you can copy the shape like this...

Code:
activesheet.shapes("Diagram 1").CopyPicture

Then you can paste the picture into your chart so that it can be exported. Change the name of the shape accordingly.

Hope this helps!
 
Last edited:

pbassett

Active Member
Joined
May 5, 2004
Messages
358
Thanks! Also the chart initially contained data so I needed to empty it out with
Code:
ActiveChart.ChartArea.Clear
 

Watch MrExcel Video

Forum statistics

Threads
1,129,405
Messages
5,636,102
Members
416,898
Latest member
imsorrymen

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