Save as JPG or PNG

S

Spike

Is there any way to save a range/selection of excel cells as a jpg or png or
any picture format.

I have a graph on an excel page, and i want the jpg to also contains the
information in the cells about it.

I know how to save the chart by itself....
ActiveChart.Export Filename:=MyFiles.BuildPath(ScansPath, TestNumber) & " "
& RunNumber & ".png", FilterName:="PNG"

But have no idea how to print/export a page to a picture format.

Any help at all would be great, thanks,
 
A

Andy Pope

Hi,

You can copy the range and paste in within the chart before exporting.
Something like this

' chart data
Range("B2:C6").CopyPicture xlScreen
With ActiveChart
.Paste
.Export "C:\temp\pic1.gif", "gif"
End With
'ActiveChart.Export Filename:= _
' MyFiles.BuildPath(ScansPath, TestNumber) & " " _
' & RunNumber & ".png", FilterName:="PNG"

Cheers
Andy
 
S

Spike

Andy,

I hate you!! J/k. No, in all seriously though, thank you very much!!
Although i dont understand why i cant print a page to a jpg real easily, the
solution you have provided is one i have been searching for, well, for a long
time. I cant believe i have never come across that before, or maybe i just
never worded the question right before. i dont know. But thank you very very
much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top