Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatic Export of Excel Charts using User Add-In

Status
Not open for further replies.

dac5039

Programmer
Aug 12, 2009
22
US
Hello,

I need to automatically export three charts as .png files and save them somewhere on my machine. I found a user-made add-in here that can save excel charts as images to any location, but I can't seem to code a module that automatically does this for 3 charts...

What I did was install the add-in and verify that it works manually, which it does. The add-in module installs a button in the "Add-Ins" tab called Export Chart, which brings up a Save As dialogue upon being clicked when a chart is highlighted. So saving charts one-by-one isn't a problem. However, I then recorded a macro of simply clicking on my first chart, clicking the Export Chart Add-In button, specifying the file name and location, confirming the save, and moving on to do the same for charts 2 and 3, which are on independent sheets. This resulted in the automated macros all completing successfully, but none of the charts being saved externally as .png files. Can anyone offer some advice please?

The macro-enabled excel file is attached to this post, which contains my string of module calls under "This Workbook" (which all are successful even though the final module attempting to export 3 charts doesn't do that) as well as the installed add-in code which is now automatically associated with each workbook I open (PTSExportChart). The data file read-in by excel and the workbook which installs the Export Chart add-in can also be found at the attached link.

Thanks for the help!

dac5039
 
May be you can incorporate lilliabeth's suggestion in the thread below into a macro.
thread68-1577880

I am sorry I don't use add-ins unless I just can't do without it; as such, I wouldn't even try your xla.

A man has only two choices: He can be right or he can be happy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top