+ Reply to Thread
Results 1 to 5 of 5

Import files from external folders

  1. #1
    Registered User
    Join Date
    05-22-2013
    Location
    Limassol, Cyprus
    MS-Off Ver
    Excel 2010
    Posts
    7

    Import files from external folders

    Hi,

    I want to create a macro that whenever is run it will look into a specific folder and it will search for certain files and then load them back to excel.

    e.g. I will have a list in excel such as:

    photo1.jpg
    photo2.jpg
    photo3.jpg

    In the excel file I will also specify the folder location e.g. C:\\User\Pictures

    What needs to be done then is for the macro to go into Pictures folder specified above, find photo1 and if it finds a match then load the picture in excel.

    I know how to create loops and everything in order to do it for the whole list but I just need help on how to perform the search and load part.

    Thanks

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Import files from external folders

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Import files from external folders

    patel, you would need an error handling procedure for if the picture doesn't exist. For what it's worth I would do it like this:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-22-2013
    Location
    Limassol, Cyprus
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Import files from external folders

    I have tried both macros and I get different kind of errors; however both errors relate to the insert method. Please see attached files which are the errors I get.

    1.jpg is the error that I get when running the loadImage macro that @patel45 posted
    1.JPG

    2.jpg is the error that I get when running the Macro 1 that @yudlugar posted
    2.JPG

  5. #5
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Import files from external folders

    Sorry, just re-looked at my code, I checked it before posting but when changing it over to your path I missed out a "\". Try 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)

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