+ Reply to Thread
Results 1 to 11 of 11

Extract and Save all JPG Objects in Excel Workbook?

  1. #1
    Registered User
    Join Date
    06-18-2012
    Location
    Chicag, IL
    MS-Off Ver
    Excel 2007
    Posts
    5

    Extract and Save all JPG Objects in Excel Workbook?

    Hi there,

    I have a number of excel files with embedded (object) jpgs. I am being asked to upload these photos individually to specific line items of a client's online database.

    Right now I'm having to open each embedded object one by one, save them to my computer, and then upload. Is there a way to extract all of these jpgs to a folder on my computer?

    **note that I've tried saving the file as a webpage and using the "embedded" folder. This is yielding all binary OLE Object files which I cannot open/convert to pictures files.

    Excel JPGs.png

    Attached is a small sample of what I'm working with. Thanks very much for your help!
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Extract and Save all JPG Objects in Excel Workbook?

    Hi dlello,

    This will group them so they can all be moved at once:

    Please Login or Register  to view this content.
    Directions for running the routine(s) just supplied

    Copy the code to the clipboard

    Open your Workbook

    Save your Workbook or Another Workbook designated for Macros as Macro_Enabled

    Press ALT + F11 to open the Visual Basic Editor.

    Select “Module” from the Insert menu

    Type "Option Explicit" then paste the code under it

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Extract and Save all JPG Objects in Excel Workbook?

    starnge i can save it as html and get the folder and get the images ok
    Attached Images Attached Images
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    06-18-2012
    Location
    Chicag, IL
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Extract and Save all JPG Objects in Excel Workbook?

    Quote Originally Posted by martindwilson View Post
    starnge i can save it as html and get the folder and get the images ok
    If you try opening the images all you get is the thumbnail placeholder, not the image itself. See how small the image files are?

  5. #5
    Registered User
    Join Date
    06-18-2012
    Location
    Chicag, IL
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Extract and Save all JPG Objects in Excel Workbook?

    Quote Originally Posted by xladept View Post
    Hi dlello,

    This will group them so they can all be moved at once:

    Please Login or Register  to view this content.
    Directions for running the routine(s) just supplied

    Copy the code to the clipboard

    Open your Workbook

    Save your Workbook or Another Workbook designated for Macros as Macro_Enabled

    Press ALT + F11 to open the Visual Basic Editor.

    Select “Module” from the Insert menu

    Type "Option Explicit" then paste the code under it

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name
    I am getting the following error upon running:

    Excel JPGs - VBA Error.jpg

    Any ideas?

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Extract and Save all JPG Objects in Excel Workbook?

    Hi DLello,

    It runs for me on both my 2003 and my 2010 - is there anything else that I should know?

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Extract and Save all JPG Objects in Excel Workbook?

    i cant even open the image from the thumbnail in the original

  8. #8
    Registered User
    Join Date
    06-18-2012
    Location
    Chicag, IL
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Extract and Save all JPG Objects in Excel Workbook?

    Quote Originally Posted by xladept View Post
    Hi DLello,

    It runs for me on both my 2003 and my 2010 - is there anything else that I should know?
    No, interesting... I'm running 2007 but I don't think that should make a difference. And we're working with the same file so I'm really not sure why I'd be getting an error.

    I'll see what I can figure out. So this macro does what exactly?

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Extract and Save all JPG Objects in Excel Workbook?

    Hi DLello,

    The macro just groups all the Images (like you sent in your sample) so that you can then move them all at once - if you had a destination, we could probably code the whole move.

    @Martin - I did right-click - Package Object - Activate contents (It's a nice picture from above a highway).

  10. #10
    Registered User
    Join Date
    06-18-2012
    Location
    Chicag, IL
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Extract and Save all JPG Objects in Excel Workbook?

    Quote Originally Posted by xladept View Post
    Hi DLello,

    The macro just groups all the Images (like you sent in your sample) so that you can then move them all at once - if you had a destination, we could probably code the whole move.

    @Martin - I did right-click - Package Object - Activate contents (It's a nice picture from above a highway).
    Yea if you could help me code the whole thing that would be great. The destination folder would be located at: C:\Users\lel69316\Desktop\Sample Embedded Final

    Thanks again!

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Extract and Save all JPG Objects in Excel Workbook?

    Hi Dlello,

    You'll need a book named Sample Embedded Final.xlsx with a Sheet1 for this:

    Please Login or Register  to view this content.

+ 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. extract data from multiple worksheets and save to the respecting workbook
    By anitra in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2013, 05:05 AM
  2. VBA Extract and Save Embedded Objects... Step Thru Works, Run Does Not!
    By mark5767 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 05-31-2013, 09:40 PM
  3. [SOLVED] VBA extract X number of rows and save as new workbook
    By freud1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2012, 07:21 AM
  4. [SOLVED] Remove all macros and objects in Excel, Save and Quit
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-02-2006, 07:45 AM
  5. Replies: 0
    Last Post: 06-02-2006, 07:30 AM

Tags for this Thread

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