• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Exported graphs from Excel 2003 not appearing correctly

Sreya612

New Member
Hi all,


I've been using a macro to export graphs to a certain location:


Worksheets("Sheet1").ChartObjects("Chart 1").Chart.Export Filename:="C:Documents and Settingsuser1DesktopGraph1.gif", FilterName:="GIF"


(I've changed the specifics above to some generic names.)


What I have found is that the exported GIFs do not look the same as the graphs in Excel. The legends are to one side and truncated, the chart area and title change in size, and so on.


I've tried exporting as GIF, PNG and JPG and have found the same result for all.


Can anyone help me with preserving the format please?


Many thanks.
 
This may be what you're using already, but I'd recommend looking here:

http://peltiertech.com/WordPress/enhanced-export-chart-procedure/
 
Hi Luke,


Thanks for the post. To be honest, I think that's a bit too complicated for me - I'm somewhat of a beginner to writing VBA.


My macro is working fine to pick up and export the graphs in the worksheet. But when they are exported, they don't look right in all instances. Some do - and others seem to be tranformed by the export process.


I was just wondering what could be causing the formatting to shift and how it could be corrected.


If you can help me to write a simple macro that I can run that will do the same as the above (I'm happy to manually change the name of the sheet and chart as there are only a few) but will preserve the chart exactly, that would be a great help.


Many thanks.
 
Just to add to this, I've found that if I export the graphs one by one, the formatting remains in place. It's when I do a whole set of them at once, that the formatting is changed.
 
I've now solved this problem by using a different macro to export the graphs:


Worksheets("Sheet1").ChartObjects("Chart 1").Activate

ActiveChart.Export "C:Documents and Settingsuser1DesktopGraph1.gif"


This seems to work fine.


Thanks for the help.
 
Thanks for letting us know you found a solution. Hope we can be of (better) help again sometime!
 
Back
Top