vba to copy all charts on worksheet at larger size, export then delete

reece1984

New Member
Joined
May 15, 2012
Messages
18
Hi All,

I have a dashboard of over 20 small charts that I would like to export as png images at a larger resolution.
The macro that I have at the moment exports the charts but does not resize them. In order to export larger charts I think that my code needs to make a copy of each chart at a larger resolution (say 1200x1200), export it, and then delete the copy and move onto the next chart.

Could anybody please help me improve the code below to do this?


Code:
Sub ExportCharts()

Dim objCht As ChartObject
For Each objCht In ActiveSheet.ChartObjects
objCht.Chart.Export "H:\desktopxp\charts\" & objCht.Name & ".png", "PNG"
Next objCht
End Sub

Thank you.

Reece
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Hi All,

Please consider this thred closed. I have figured out that by zooming in on the excel dashboard before running the export macro then the images all export at a higher resolution.
 
Upvote 0

Forum statistics

Threads
1,215,444
Messages
6,124,891
Members
449,194
Latest member
JayEggleton

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