Friday, January 14, 2011

Microsoft Excel Chart Exporting

Someone in my company came across a requirement for exporting charts in Microsoft Excel. It was then that he came across some automation for the same. He got a tool for himself, but it was quite buggy and very small in features. It was then that I thought of creating one for myself and what I could see was that there are tools available in the market, but people have kept the code password protected and licensed. I thought of making an excel add-in and making the keeping the code open for use. 

I have used the “Sheets ().ChartObjects(i).Chart.Export” to export the charts in excel. Please download the OpenChartExporter add-in here. It is simple to use. Find the steps to install and use the add-in below.

Steps to Install the Add-In:
  1. Download the attachment.
  2. Open Excel, import the addin (Tools --> Add-Ins --> Browse and add the downloaded vba file).
  3. Check the flag against the Add-In OpenChartExporter.
  4. Click OK button and that’s it!
Note: This is a onetime activity to install the add-in

How to Use:
  1. Open the Excel with charts
  2. Press Keys “Control + e” to invoke the menu
  3. Select the target file type, target folder to save the exported image and worksheet whose charts needed to be exported
  4. Select the chart to be exported, or use the “export all” button to export all the charts available within the sheet
One can view the code by opening the Visual Basic Editor (Macro). Hope it helps you!

No comments:

Post a Comment