I have an Excel sheet with images which are stored as objects in one column and product names in another. I was trying to extract all the images to JPEG files. I was able to achieve this by saving the Excel sheet as an HTML document.
This gave me the following files
- A HTML file
- A folder with all the images together with a XML file
filelist.xml
with a list of all image files
Now I need to create a new Excel sheet which has the product names in one column and image file names in the other. I was able to achieve this using the created XML file filelist.xml.
However, this has introduced a new problem
My original Excel sheet had certain variants of products for e.g. (Product1 white, Product1 green, Product1 red, Product1 blue)
While the products are a little different in color, the associated image object was repeated. Basically all four had the same corresponding image. Now while saving this file as an HTML I found only one image file instead of four.
Also the XML file had only one entry instead of four and so the new Excel sheet I'm creating from the XML also has one entry instead of four.
Though the same object is used four times for similar products, they seem to be stored with different names. (Clicking on the 1st showed "picture1", the second "picture2" etc). This has given me hope that maybe there is a way to save images individually so I receive four JPEGs instead of one.
Best Answer
(both solutions are superior to the extract method because redundant images are exported as well)
Solution #1
Here is my VBA macro to export all pictures from a workbook.
The pictures will be saved to a folder of your choice and Excel's internal object name is used as picture filename. The code is commented and not that difficult.
How to use
Used resources
Solution #2
Use Graphics Exporter (Excel Add-In)
64-bit problem
Even the new version for Office 2007 is compiled for 32-bit systems. It won't run on a 64-bit Windows unless you fix the code like explained on Stackoverflow.
I've done those small fixes for you. Download the 64-bit version here.