Skip to main content

How to Quickly Extract Pictures From An Excel File

If you want to quickly extract pictures from an Excel file that embedded many pictures, you cannot be simply to do this. There's no build-in function to do this in Excel. Here are two simple ways to quickly extract pictures from an Excel file.

How to Quickly Extract Pictures From An Excel File

1. Open your Excel file, click File tab, choose Save As, in the Save As window, click the drop-down menu labeled Save as type:, scroll down and choose Web Page (*.htm;*.html), Click Save.

Save as Web Page File

When a web page is saved in a computer two files are actually generated. One is the html file, and another is a folder that contains all the images and other component files that are a part of the web page. For example, an Excel file named Products.xls saved as a web page will generate Products.htm and a folder labeled Products_files. If Products.xls contained images, these images will now be in the Products.xls_files folder. Now, open Products.xls_files folder, you will sell all the pictures.

All images in Web Page File
2. Change the Excel file extension (only available with .xlsx) as a RAR file, For example, change Products.xlsx to Products.rar, extract the Products.rar file, you will see 3 folders (_rels, docProps and xl) and 1 xml file ([Content_Types].xml), open xl folder, open media folder, you will sell all the images in the media folder.

All images in media folder

Update: If you need VBA to do this: Excel Macro: Export All Pictures and Rename.

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>

59 comments
  1. AR
    Arlene

    VB Macro: To save the images with the names. Hope this will help as much as it did to me

    Sub save_pic()
    '
    ' save_pic Macro
    '
    ' Keyboard Shortcut: Ctrl+p
    '
    ' Before you run the macro, select the range of data containing the filenames and pictures
    ' First column filenames, second column pictures
    '
    ' Dimension all variables.
       Dim DestFile As String
       Dim Desthtm as string
       Dim Destcell as string  
       Dim RowCount As Long
       Dim Columnf As Long
    '
    ' Turn error checking on.
      On Error GoTo 0
      Columnf = 1
    '
    ' Loop for each row in selection.
       For RowCount = 1 To Selection.Rows.Count
    '
    ' Assign Filename to variable
        Desthtm = "S:\Arlene\ETL vendorpart\EMP\" & Selection.Cells(RowCount,Columnf) & ".htm"
        DestFile = Selection.Cells(RowCount,Columnf) & ".jpg"
    '
    ' Pictures located in second column: B
    
        Destcell = "B" & RowCount
    '
    ' Save each picture into individual file with the specified name
       With ActiveWorkbook.PublishObjects.Add(xlSourceRange, _
          Desthtm, "Complete list", Destcell, _
          xlHtmlStatic, DestFile, "")
          .Publish (True)
          .AutoRepublish = False
       End With 
    '
       If RowCount = Selection.Rows.Count Then
    '
          MsgBox "End of Process- Saving Pictures"
          exit for
       End If
    '
    ' Start next iteration of RowCount loop.
        Next RowCount
    '
    End Sub
  2. JE
    Jennifer

    wow! this worked perfectly and saved me hours of work. Thank you!!!!!!

  3. JR
    Jaymee Ruiz

    Awesome thank you!

  4. NS
    Nivesh Sachdeva

    Omg! Thanks a lot. This site is amazing. This helped me a lot.

  5. QB
    QB

    why do I see each image was saved as two PNG images when saved as Web page?

  6. D
    D

    excellent!

  7. SA
    Sayed

    Thank you very much.

  8. MA
    Marian

    THANK YOU!!! You just saved like 3 hrs of my life 😉

  9. GC
    Giovanni Corrado

    My Excel got 744 rows and in every row there is an image. So I have 744 images!
    When i try your 2nd solution , in MEDIA folder i found 607 images.
    With 1st solution i found 1345 images (cause they were duplicate, but not everyone or i will have 1488. Can you help me please

  10. GC
    Giovanni Corrado

    hello, i want to convert that image as link, because i can only import the link of the images...can I do this on excel?

  11. RO
    Rodrigo

    Hey, that was a neat solution. Thanks! Best one so far in 2019 😉

  12. LS
    Lukman Salim

    There is a SIMPLER way! just unzip the .xlsx file, there will be a folder structure, all the images will be under "xl/media"

  13. CD
    Cheila Dias

    I just want to save a few charts as images but doing save as web page the image is png instead of jpeg. How can I change it?

  14. QU
    quy

    thanks so much

  15. AN
    Anita

    I tried this but it's not extracting the logo in the footer which is the one I need to extract to use in other files.

    Can you please help?

    Thanks,

  16. MA
    maggie

    ooooooommmmggggg!!!this is so helpfullllll..Thanks guys

  17. BR
    brian

    Thank you was easy to extract

  18. MI
    Mimino

    Thanks!

  19. DE
    Developer

    Thank you so much,you saved my time..

  20. CO
    Corrado

    great solution but can anyone advise how to save the pic with the name in the corresponding excel row?

  21. OM
    Omerg

    Wow, that is practical!
    Thank you...

  22. NW
    Nick W

    This is excellent - what a great tip, so simple. I can't believe how much time and faffing about this saves me.

    Thank you!

  23. NF
    Nuno Ferreira

    Thanks. Great Tip.
    Saved me precious time!

  24. AR
    arun

    thank you

  25. IA
    Ian

    Thank you!! You saved me a BIG job!! I tried copying and pasting to Photoshop before I found this!

  26. MR
    Muhammad Rafeeq

    Wow amazing thank you buddy for share this helpful article.

  27. GI
    gin

    Thank You SIR

  28. KR
    Kris

    This is the best - thank you so much for sharing!

  29. SJ
    SUDESH JHA

    THANKS A TON...THIS IS AWESOME TRICK..WE USE EVERYDAY BUT DON'T KNOW TO USE..:))

  30. IC
    Iordache Cristian

    Thank you, this is brilliant!

  31. CL
    Clare

    Perfect, thank you!

  32. PR
    prasad

    Thank you

  33. ED
    Edgar

    Thank you for saving me days of work.

  34. JP
    jignesh patel

    Yes , We got our jpg file, but We need to save that JPG file to particular field. In this example Column A is model name, so jpg file will save that name.

    • AB
      Abdel

      @jignesh patel Hi,

      Did you find how to rename the image according to specific columns ?

      Thanks.

  35. LU
    lucy

    Thank you, this is brilliant!

  36. SA
    Sarah

    Thanks a lot! So helpful.

  37. DA
    Dave-o

    awesome! thanks

  38. YA
    Yanir

    is there anyway to rename the images according to specific column ?

    • AB
      Abdel

      @Yanir Hi Yanir,

      Did you find how to rename the image according to specific columns ?

      Thanks.

  39. AK
    akshay

    duplicate images will be copied once only.

  40. AV
    avinash

    This is simply awesome solution.

  41. TB
    TBomb

    This is great. thanks.

  42. TB
    Tomov, Bulgaria

    Thank you! This is very helpfull for me and my work! Thank you!

  43. SH
    Shail

    Thanks a lot

  44. DA
    dave

    I tried this solution but for some reason it saves each image twice. Any Idea why that might be?
    Thanks

  45. SH
    Shik

    awesome solution so far! you rock! 🙂

  46. MN
    Michael Nolsøe Madsen

    This is a bad solution as the images are extracted using the resolution of the cell and not the source image.

    • KE
      Keshav

      @Michael Nolsøe Madsen Hi Michael.. then what you do, is first change the size of all pictures quickly. press F5 and choose to select all objects. then in the picture tools all the way on the right choose a size for the width, let's say 5" and then follow the procedure above, which btw is an excelent solution!

      • TN
        Tammy N

        @Keshav Hi Keshav,
        Thanks so much, you make life easier. =)

      • MA
        Matt

        @Keshav This page was VERY HELPFUL, especially your suggestion about using F5 to select all, then resizing to a common width. Thanks

  47. NA
    naz

    thanks a lot saved my time
    reallly thank you

  48. RA
    Raj

    Simple and perfect solution

  49. NT
    Naama t

    Very nice. Is there any way to save the images with the names defined in the worksheet? I.e "iPhone 5s"?

  50. TR
    Trie

    Simple yet very useful. Thank you so much

  51. NO
    Noel

    Simple solution. Thank you very much.

  52. BD
    Bis Das

    By far the easiest and most efficient solution