Hi there folks, hoping to get some help with a strange error. I use the below code to export charts as pics. The below code works great but will only do so on 3 of the 7 charts always works for the first 3 then error saving the picture (actually no error saving just save as 0kb empty or corrupt file). When I go to the page with the charts and click into them all one by one (activate them) then works fine.
thanks for any help.
thanks for any help.
Code:
Private Sub UpdateChart()
Application.ScreenUpdating = False
Set CurrentChart = Sheets("Schedule Tool1").ChartObjects(ChartNum).Chart
' Save chart as GIF
'Fname = ThisWorkbook.Path & Application.PathSeparator & "Chart.tif"
Fname = "C:\WINDOWS\Temp" & "Chart.gif"
CurrentChart.Export Filename:=Fname, FilterName:="GIF"
Application.ScreenUpdating = False
' Show the chart
Image1.PictureSizeMode = 1
On Error Resume Next
Image1.Picture = LoadPicture(Fname)
End Sub