Saving an image from a worksheet in a temporary folder

Cease

Board Regular
Joined
Dec 28, 2010
Messages
112
Hi,
I'm trying to take an image from a worksheet and save it as a temporary file using vba... anyone know if this is possible or how to do so?

For any examples I'm trying to use:
"Sheet1" and "Picture1"

Any advice or direction would be greatly appreciated.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
This is one way:-
Copy picture to Chart Object:- save as "Gif" file "First Code"
Code:
Private Sub CommandButton1_Click()
Dim Cht As Object, fName As String
Set Cht = Sheets("Sheet4").ChartObjects(1).Chart
fName = "C:\Documents and Settings\test\Desktop\dog.gif"
Cht.Export Filename:=fName, Filtername:="GIF"
End Sub
Retrieve picture to Image control on sheet.
Code:
Private Sub CommandButton2_Click()
Image1.Picture = LoadPicture("C:\Documents and Settings\test\Desktop\dog.gif")
End Sub
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,702
Members
452,938
Latest member
babeneker

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