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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting excel charts as images

Status
Not open for further replies.

terzaghi

Programmer
Aug 25, 2003
49
IT
I want to do this:
I have an excel spreadsheet with some graphs.
every week I update all the data and I have to present in a ppt all the updated graphs.
Now my bosses want to show all this stuff not in a ppt format but in a web format. so I have to take all the graphs from excel and put them in html pages. it will be very easy if I could take the graphs and save them as .bmp or .gif so that the web pages can take them in an easy way. Once I make the html pages the first time, the update of the website should be straightforward.

can anyone send me a VBA macro with the code to save the image as bmp of gif?
thanks
Andrea
 
Set it up so that the chart is on its own sheet along with whatever other information you want for the web page then save as web page. If you want to automate this process, use the macro recorder to get the code.

[blue]"Well, once again my friend, we find that science is a two headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is BAD! Oh, beware the other head of science, Arthur; it bites!!" - The Tick[/blue]
 
Andrea,

The Macro Recorder comes in real handy for DISCOVERING how stuff like this happens!

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Really Great!!!
Thakns to both of you!!!!!!
It works really fine!!!
 
Once you have discovered how to save the chart as an image...
Code:
'this is for chart sheets
    For Each ch In ThisWorkbook.Charts
        'save your chart image
        MsgBox ch.Name
    Next
'this is for embedded chart objects
    For Each ws In ThisWorkbook.Worksheets
      For Each co In ws.ChartObjects
        'save your chart image
        MsgBox co.Chart.Name
      Next
    Next
will cycle thru all chart sheets and embedded chart objects

:)


Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top