Results 1 to 2 of 2
Thread: Batch Image Saving
2009-09-15, 11:43 #1
- Join Date
- Sep 2009
- Thanked 0 Times in 0 Posts
Hoping someone can help with the following query; has got me (and google) stumped.
The company I work for has just compiled a proper excel file for our products that we sell.
These contain our/supplier part #s, descriptions, prices, etc.
That's all fine, but we've also added pictures of the items to include on quotes (the pictures are in a column to the right of all the other details - (these pictures only exist in Excel)).
Our new quoting software tool needs a link to the filename - however, our pictures don't have logical filenames!
Is there a way we can do a batch save as of all these images so it ends up as 'part#'.jpg within folder X?
There are about 6,000 products and will be a bit of zombie work we don't really want to do!
I've found: http://www.andypope.info/vba/gex.htm : but this doesn't export in a logical order, or allow you to export as 'contentofcellx'.jpg
2009-09-15, 18:45 #2
- Join Date
- Jul 2002
- Pittsburgh, Pennsylvania, USA
- Thanked 342 Times in 335 Posts
Instead of trying to break down Pope's code to make it work for you (you may ask him to do it), I would suggest using his code as it is and rename the pictures in your file. Pope's code names them whatever the picture is named.
You could use some code like this:
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
.Name = .TopLeftCell.Offset(0, -2)
which will rename each shape to whatever the contents of the cell 2 cells to the left (-2) in the same row (0) as the cell which has the upperleft corner of the shape...
After renaming the shapes, you could run Pope's addin to export the shapes to the appropriate folder.