View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Export Chart as TIFF or JPG

Copy the chart and paste in Paint. Then save as jpg.
--
Gary''s Student - gsnu200840


"Webtechie" wrote:

Hello,

I wrote an application with Excel and VBA to create charts and then export
them as GIF. Works great. However, I then need to create a report. Crystal
Reports does not support GIF.

I need to change the code to export to TIFF or JPG. I thought I could, but
am getting an error.

Could someone please let me know how to export a chart to TIFF or JPG?


Thanks.

Here is my current code:

Set CurrentChart = Sheets("chart").ChartObjects(1).Chart

myFileName = ThisWorkbook.path & "\images\" & reviewFileName & "_" &
mPageNameStr & "_ch1.gif"

If Not FileExists(myFileName) Or iChartFlag = "Y" Then
CurrentChart.Export FileName:=myFileName, FilterName:="GIF"
End If

Me.Image1.Picture = LoadPicture(myFileName)

This works great. I tried changing GIF to TIFF or JPG. I get this error
message.

The specified dimension is not valid for the current chart type. ??!!


Thanks,

Tony