Public Sub Save_Pictures()
Dim saveInFolder As String
Dim shp As Shape
saveInFolder = "C:\Temp\"
If Right(saveInFolder, 1) <> "\" Then saveInFolder = saveInFolder & "\"
For Each shp In ActiveSheet.Shapes
If shp.Type = msoPicture And shp.TopLeftCell.Column = 3 Then
Save_Object_As_Picture shp, saveInFolder & shp.TopLeftCell.Offset(0, -1).Value & ".jpg"
End If
Next
End Sub
Private Sub Save_Object_As_Picture(saveObject As Object, imageFileName As String, Optional scaleFactor As Single)
'Save a picture of an object as a JPG/JPEG/GIF/PNG file
'Parameters
'saveObject - any object in the CopyPicture method's 'Applies To' list, for example a Range or Shape
'imageFileName - the .gif, .jpg, or .png file name (including folder path if required) the picture will be saved as
'scaleFactor - the factor by which the width and height will be scaled in the saved image
Dim temporaryChart As ChartObject
Application.ScreenUpdating = False
saveObject.CopyPicture xlScreen, xlPicture
Set temporaryChart = ActiveSheet.ChartObjects.Add(0, 0, saveObject.Width, saveObject.Height)
With temporaryChart
.Activate 'Required, otherwise image is blank
DoEvents
.Border.LineStyle = xlLineStyleNone 'No border
.Chart.Paste
If scaleFactor > 0 Then
.Width = .Width * scaleFactor
.Height = .Height * scaleFactor
End If
.Chart.Export imageFileName
.Delete
End With
Application.ScreenUpdating = True
Set temporaryChart = Nothing
End Sub