I have an embedded chart object in my worksheet. I’m wrote a code which will export the chart to a GIF file, but it comes with an Run-time error ’91’ in line 7. How can I fix this?
Private Sub SaveGIF_Click()
Dim chtChart As ChartObject
Dim FileName
FileName = “Temperature.gif”
FileName = Application.GetSaveAsFilename(FileName)
If FileName False Then
chtChart.Chart(“TemperatureChart”).ExportPicture FileName, Width:=320, Height:=240
End If
End Sub