View Single Post
  #1   Report Post  
tmidgett tmidgett is offline
Junior Member
 
Posts: 1
Default Chart issue--works in 2007, not in 2010

I have an application that creates a chart, exports said chart as .gif, creates a sheet in another workbook, and inserts the .gif into that sheet.

Here's the code.

Sheets("CHART").Select
Dim mychart1 As Chart
Set mychart1 = ActiveChart
mychart1.Export Filename:="c:\Chart.gif", FilterName:="GIF"
'Paste the chart into the Archive File
Dim mainBook As String
mainBook = ActiveWorkbook.Name
Windows("GifBook.xls").Activate
Sheets(1).Select
Sheets.Add
Range("A1").Select
ActiveSheet.Pictures.Insert("C:\Chart.gif").Select

From there, the code takes in new data, overwrites the old chart, and re-executes the code above. I end up with GifBook.xls having all the charts I need, as .gifs, one on each sheet in the workbook.

All that stuff works peachy in Excel 2007. I can save the GifBook file, and all the charts (pages of them) are there when I reopen it.

If I run the code in Excel 2010, I see GifBook with all the charts as well. But if I save it and reopen it...I get properly named pages that are ALL populated with the first chart I inserted into the sheet. All sheets have the same chart.

It's a bit baffling, but perhaps someone has a solution? I tried saving as .xlsx and copying the sheets into yet another workbook one by one.

Thanks much.