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

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,223,911
Messages
6,175,335
Members
452,636
Latest member
laura12345

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