Invalid image error :481 when displaying charts as image

djemy1975

Board Regular
Joined
Jan 18, 2016
Messages
51
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:

Code:
[/COLOR][COLOR=#3E3E3E]Image1.Picture = LoadPicture(Fname)[/COLOR][COLOR=#3E3E3E]


My function is as follows:
Code:
[/COLOR][COLOR=#333333]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[/COLOR]
[COLOR=#333333]


Could someone tell me where is the error ?
 
Last edited:

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,225,374
Messages
6,184,606
Members
453,247
Latest member
scouterjames

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top