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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi friends,

I am still stuck in this problem.Could someone help me to get over.

I would be grateful.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,559
Members
449,089
Latest member
Motoracer88

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