Dear friends,
Please be kindly requested to help me get over a problem in displaying charts (7 charts)as images in my userform .The problem is when navigating from image to image by using next and previous buttons I get this error "Invalid image 481" error and when debugging the cursor comes over this line which is highlited with yellow colour:
Image1.Picture = LoadPicture(Fname)
My function is as follows:
Private Sub SaveChart() Dim MyChart As Chart
Dim Fname As String
Set MyChart = Sheets("Charts").ChartObjects(ChartNum).Chart
'MyChart.Parent.Width = 400
'MyChart.Parent.Height = 350
Fname = ThisWorkbook.Path & Application.PathSeparator & "temp.gif"
MyChart.Export Filename:=Fname, FilterName:="GIF"
' Show the chart
Image1.Picture = LoadPicture(Fname)
End Sub
Could someone tell me where is the error ?
Bookmarks