Save pictures out as file?

HotLanta

Board Regular
Joined
Nov 3, 2005
Messages
176
I have a spreadsheet that has 21 pictures. "Picture1", "Picture2", etc.

Is it possible for a script to save each picture out as a .bmp?

Thanks!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I don't know about bmp, but Andy Pope has an Add-In:

http://www.andypope.info/vba/gex.htm

Or maybe you can use this:

Code:
Sub Test()
'   Change to suit
    Const Folder As String = "C:\Pictures\"
    Dim Pic As Picture
    Dim ShTemp As Worksheet
    Dim ChTemp As Chart
    Dim PicTemp As Picture
    Application.ScreenUpdating = False
    For Each Pic In ActiveSheet.Pictures
        Set ShTemp = Worksheets.Add
        Charts.Add
        ActiveChart.Location Where:=xlLocationAsObject, Name:=ShTemp.Name
        With Selection.Border
            .Weight = 2
            .LineStyle = 0
        End With
        Set ChTemp = ActiveChart
        Pic.Copy
        ChTemp.Paste
        Set PicTemp = Selection
        With ChTemp.Parent
            .Width = PicTemp.Width + 8
            .Height = PicTemp.Height + 8
        End With
        ChTemp.Export Filename:=Folder & Pic.Name & ".jpg", FilterName:="jpg"
        Application.DisplayAlerts = False
        ShTemp.Delete
        Application.DisplayAlerts = True
        Application.ScreenUpdating = True
    Next Pic
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,746
Members
448,989
Latest member
mariah3

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