How can I extract images from an Excel sheet, and control their file names?

1

I have an Excel sheet with the following columns

  1. Product ID
  2. Product Name
  3. Images

Images are placed on the worksheet but not in any cell. I want to extract the images as files (jpg, png, gif, etc) and I also want them to be named according to values in the "Product Name" column.

So the 1st image will be named according to the 1st value in "Product Name" Column, the second according to the second etc.

As a workaround, I'm able solve the extracting part by saving the Excel sheet as a HTML document, which also saves the images I want. However I'm unable to control the image names: Excel sets a pre-defined name, like image1.jpg, image2.jpg etc.

So, what I want is

if the "product name" column has the following values ;

  1. product1
  2. product2
  3. product3

I should have images with the name

  1. product1.jpg
  2. product2.jpg
  3. product3.jpg

TDsouza

Posted 2013-05-31T11:15:22.727

Reputation: 183

1I'm afraid this is not clear enough. Excel cells can contain values or formulas. They cannot contain images. You can insert images into a worksheet, but they are managed on a separate layer, not "in" a cell. An image object can be positioned relative to a cell. You may want to provide a sample file and detail your requirements some more. – teylyn – 2013-05-31T11:47:28.497

1I agree with @teylyn because Excel is not good for managing images. If you are creating this spreadsheet you may want to consider using links to the images or use a different application. If you just trying to extract the data out of it, that is different. Please clarify. – CharlieRB – 2013-05-31T11:50:59.927

You can do this with VBA selection.shaperange.name will assign a name based upon a cell. However, your worksheet will need to be organized in such a manner that it can associate the correct image with the appropriate cell for a label. – dav – 2013-05-31T18:40:05.543

I have edited the Question accordingly, basically I only want to extract the images as files and at the same time I also want to control the file names according to the values in "Product Name" Column. – TDsouza – 2013-06-01T05:51:51.313

No answers