Download Source Code : Extract Images from Excel Worksheet -

Name of the Tool

Extract Images from Excel Worksheet- Macro

Brief Description of the Tool

Extract all the images embedded on the worksheet as a separate file in jpg format

Code Snippet

Sub PastePic_4mExcel()
Dim Images_all As Shape
Dim cntr As Integer
cntr = 1
For Each Images_all In ActiveSheet.Shapes
    ActiveWorkbook.Sheets("General Electric").Shapes(cntr).Select 'BottomRightCell.Select
    Selection.CopyPicture xlScreen, xlBitmap ' copy image to clipboard
    Shell "mspaint.exe", vbMinimizedFocus  'vbMaximizedFocus'Open Paint, wait two seconds while the application starts
    t = Timer:   Do Until Abs(t - Timer) > 2: Loop
    SendKeys "^(v)", False 'True 'Paste into Paint
    SendKeys "^(s)", True 'Show Save as dialog
    SendKeys "C:\Temp\test" & cntr & ".jpg", True 'Enter filename and press Enter
    SendKeys "{ENTER}", True 'Press Enter key
    SendKeys "%{F4}", True 'Quit Paint
    cntr = cntr + 1
Next Images_all
End Sub


This macro works only with office XP.

Copyrights 2016,