Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Save as JPG or PNG

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,

--
Jeff "Spike" Zapinski
FAS Project Engineer
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Save as JPG or PNG

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

Spike wrote:
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,


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Save as JPG or PNG

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.

--
Jeff "Spike" Zapinski
FAS Project Engineer


"Andy Pope" wrote:

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

Spike wrote:
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,


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save, save as, page setup dimmed out in unprotected excel sheet? ccKeithJ Excel Discussion (Misc queries) 3 December 14th 07 07:07 PM
Save As and save current numbers not the actual formulas and links Frank Menard Excel Discussion (Misc queries) 2 November 9th 06 09:18 PM
How to diasble save and save as menu but allow a save button hon123456 Excel Programming 1 June 12th 06 09:50 AM
Totally Disabling (^ save ) (Save as) and Save Icon – Which code do I use: harpscardiff[_10_] Excel Programming 8 November 10th 05 12:24 PM
Why system asks me to save change even after I call save method(VB.NET) steellock Excel Programming 2 April 27th 04 04:14 AM


All times are GMT +1. The time now is 07:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"