+ Reply to Thread
Results 1 to 10 of 10

Importing Images

  1. #1
    Registered User
    Join Date
    08-07-2016
    Location
    UK
    MS-Off Ver
    2010
    Posts
    5

    Importing Images

    Good Afternoon,

    I hope you are all well?

    I am currently trying and failing to get images to import from the directory location based on the file name. I have found some code online and modified it for our purposes but it still seems not to be working. I am currently getting a 'Subscript Out Of Range' error.

    To assist with the issue I have provided the code below and also to advise I am using Excel on a Mac. Hopefully this should not create too many issues. Any assistance would be much appreciated.

    Code:

    Please Login or Register  to view this content.
    I have currently got the image file name in Column A Row 1.

    Thanks again for any assistance in advance.
    Last edited by YorkChap; 08-07-2016 at 09:48 AM.

  2. #2
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Importing Images

    Is your sheet that you are trying to import it to called "Object"?
    Note that is hard coded in the macro here.

    Please Login or Register  to view this content.
    at the beginning and end.
    Last edited by scottiex; 08-07-2016 at 06:16 PM.

  3. #3
    Registered User
    Join Date
    08-07-2016
    Location
    UK
    MS-Off Ver
    2010
    Posts
    5
    Quote Originally Posted by scottiex View Post
    Is your sheet that you are trying to import it to called "Object"?
    Note that is hard coded in the macro here.
    Good Evening

    The sheet has no title so I think it will be called 'Sheet1'. Where you mention 'object' is that refering to the sheet name?

    Thanks.

  4. #4
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Importing Images

    Yes,
    in that case then

    find and replace
    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-07-2016
    Location
    UK
    MS-Off Ver
    2010
    Posts
    5

    Re: Importing Images

    Quote Originally Posted by scottiex View Post
    Yes,
    in that case then

    find and replace
    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.
    Thank you for your assistance on this one. This has now allowed me to step forward. I now get a new error which says....

    Microsoft Visual Basic. License information for this component not found. You do not have an appropriate license to use this functionality in the design environment.

    As I am using a Mac would I need to install VB on a Windows PC and complete this Excel task or is there another solution or am I missing something?

    Thanks again.

  6. #6
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Importing Images

    Quote Originally Posted by YorkChap View Post
    Thank you for your assistance on this one. This has now allowed me to step forward. I now get a new error which says....

    Microsoft Visual Basic. License information for this component not found. You do not have an appropriate license to use this functionality in the design environment.

    As I am using a Mac would I need to install VB on a Windows PC and complete this Excel task or is there another solution or am I missing something?

    Thanks again.
    I believe if you are on a mac you will need to use the Dir function
    this sort of syntax
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-07-2016
    Location
    UK
    MS-Off Ver
    2010
    Posts
    5

    Re: Importing Images

    Quote Originally Posted by scottiex View Post
    I believe if you are on a mac you will need to use the Dir function
    this sort of syntax
    Please Login or Register  to view this content.
    Thanks again. I have tried to run it on a Windows machine using the code below and I get the error message once again which says 'subscript out of range'.

    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Importing Images

    Something like

    Please Login or Register  to view this content.
    I think Dir is slightly faster that fso FWIW
    Last edited by scottiex; 08-08-2016 at 05:24 PM.

  9. #9
    Registered User
    Join Date
    08-07-2016
    Location
    UK
    MS-Off Ver
    2010
    Posts
    5
    Quote Originally Posted by scottiex View Post
    Something like

    Please Login or Register  to view this content.
    I think Dir is slightly faster that fso FWIW
    I will give this a go tomorrow. Do you think this will work on both mac and windows?

  10. #10
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Importing Images

    probably.
    i don't have a mac so I cant test it but I have written things for mac before (working blind).

+ 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: 1
    Last Post: 04-13-2016, 08:46 AM
  2. Importing multiple images to multiple workbooks
    By moler86 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-09-2013, 10:42 AM
  3. Importing images & image names from a folder into excel spreadsheet
    By RaquelG in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-13-2012, 06:11 AM
  4. Replies: 1
    Last Post: 04-03-2012, 02:02 PM
  5. Importing Images
    By mdm1205 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2011, 04:37 PM
  6. Importing non-standard images into Excel
    By iterature in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2007, 05:29 AM
  7. Importing images to Excel and macros/web queries?
    By jsartrean in forum Excel General
    Replies: 0
    Last Post: 02-07-2007, 04:04 PM

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