+ Reply to Thread
Results 1 to 9 of 9

Exporting images from excel

  1. #1
    Registered User
    Join Date
    04-07-2014
    Location
    7530
    MS-Off Ver
    Excel 2013
    Posts
    5

    Exporting images from excel

    Hi All,

    Just looking for some quick help with a script to help me do the following. Still very very new to vba myself but trying to learn!

    I have been presented with an excel document, with image names in one column (e.g. 832005_001), and hyperlinks in another column (http://www.xyz.com/images/product.jpg).

    My goal is to export the hyperlinks in the excel document into a folder as images with the corresponding image names. Is this possible to do without manually opening each link and saving it in a document, and manually renaming each picture in accordance with its image name? (as there are over 4,000).

    Thanks and much appreciated!

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,575

    Re: Exporting images from excel

    Welcome to the forum!

    Please attach a short file so that we can best help.

  3. #3
    Registered User
    Join Date
    04-07-2014
    Location
    7530
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Exporting images from excel

    Image Upload Example.xlsxThanks Ken!

    I have attached an example, I hope this helps.

  4. #4
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,575

    Re: Exporting images from excel

    I think you mean download rather than upload?

    Obviously, you need to change the c:\temp\ path and maybe the .jpg string. We could always extract the file extension if needed.

    In a Module:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-07-2014
    Location
    7530
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Exporting images from excel

    Yes, that is what I meant. I tried this out and it worked wonderfully, thanks so much! However, the images are now in the folder and are named with the word image in front of them. is there any way to fix this? So if the name of the image was 345678 the file is saved as image345678.

  6. #6
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,575

    Re: Exporting images from excel

    I am confused. You want image prefixed in the filename or it is being prefixed? If the former, then just concatenate that string before the cell value is concatenated. If the latter, then your cell value has that as a prefix which would need trimmed or your path image was not delimited by the backslash. e.g. C:\image & cell.value & "jpg" would be c:\imageWhatever.jpg rather than c:\image\Whatever.jpg. Post your sub if you like.

  7. #7
    Registered User
    Join Date
    04-07-2014
    Location
    7530
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Exporting images from excel

    When the images are being saved there is a prefix attached to the images that I do not want to be attached. So in my spreadsheet the image has the name 832005_001, and when it is being saved it is being saved as image832005_001.jpg

    The following is what I am using

    Please Login or Register  to view this content.
    Thanks again for all of your help!!

  8. #8
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,575

    Re: Exporting images from excel

    After you run this, see if the word "image" is shown in the VBE Immediate Window. Otherwise, you may need to run another macro to rename the files.

    Please Login or Register  to view this content.
    I can not duplicate the image prefix problem.

  9. #9
    Registered User
    Join Date
    04-07-2014
    Location
    7530
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Exporting images from excel

    I just ran it again, and everything worked perfectly fine. No image shown! Thanks for the help, would've been a few days for me to put that all together

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 01-01-2014, 04:36 PM
  2. How to save Linked images on excel as embedded images.
    By jonelamora in forum Excel General
    Replies: 0
    Last Post: 04-18-2013, 10:29 PM
  3. exporting graphs and pivot tables as images?
    By shippers in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-21-2010, 12:53 PM
  4. exporting multiple charts as images
    By kmfdm515 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 10-06-2009, 05:17 AM
  5. Exporting text and images from IE to Excel
    By db73 in forum Excel General
    Replies: 0
    Last Post: 04-04-2007, 04:10 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1