Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Sep 2009
    Posts
    1
    Thanks
    0
    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

    Any ideas!?

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    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:
    [codebox]
    Option Explicit
    Sub RenameShapes()
    Dim shp As Shape
    For Each shp In ActiveSheet.Shapes
    With shp
    .Name = .TopLeftCell.Offset(0, -2)
    End With
    Next
    End Sub
    [/codebox]

    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.

    Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •