+ Reply to Thread
Results 1 to 5 of 5

How to reference external workbooks using only a string

  1. #1
    Registered User
    Join Date
    08-14-2017
    Location
    Ireland
    MS-Off Ver
    2010
    Posts
    7

    How to reference external workbooks using only a string

    Hi,

    I need to have cell “A1” in my current worksheet linking to a particular cell in an external workbook, called for example Sample_workbook1.xlsx.


    Cell “B1” contains the location of this cell in string format. Eg ‘x:\Main_Folder\File_Storage\[Sample_workbook1.xlsx]Sheet1’!A1



    Suppose [Sample_workbook1.xlsx]Sheet1’!A1 contains the figure €20,000,

    I want to let cell “A1” in my current worksheet to equal the value in [Sample_workbook1.xlsx]Sheet1’!A1, i.e. €20,000

    If I use the formula =b1, inside cell A1 it obviously just returns the location in string form and not 20,000.

    Also,
    I can’t use the Indirect formula like such because it doesn’t work for external folders


    =Indirect(“‘x:\Main_Folder\File_Storage\[Sample_workbook1.xlsx]Sheet1’!A1”,1)


    Does anyone know of a way in VBA to convert strings to formulae? (I tried using Evaluate but it only appears to work for numerical calculations)

    Alternatively Is there any possible work-arounds?

    I'd be greatly appreciative of any assistance,

    Thanks very much,
    Eoghan

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: How to reference external workbooks using only a string

    I can’t use the Indirect formula like such because it doesn’t work for external folders
    I believe that is incorrect. Indirect will not work from closed workbooks, so maybe you have to open that workbook first.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    08-14-2017
    Location
    Ireland
    MS-Off Ver
    2010
    Posts
    7
    Quote Originally Posted by oeldere View Post
    I believe that is incorrect. Indirect will not work from closed workbooks, so maybe you have to open that workbook first.
    Thanks for your reply, given the tasks I'll be utilising it for it will be impractical to have the referenced workbooks open, so with that in mind, do you know of any work around for referencing a closed workbook? Thanks very much

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: How to reference external workbooks using only a string

    That will be VBA (but I can't help you enough with that).

    Maybe Power Query can also be usefull (but is only available as add in in your version => 2010).

  5. #5
    Registered User
    Join Date
    08-14-2017
    Location
    Ireland
    MS-Off Ver
    2010
    Posts
    7

    Re: How to reference external workbooks using only a string

    ok thanks all the same

+ 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. Reference an object via a string (Convert a string to an objejct reference
    By grazian2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-16-2015, 11:47 AM
  2. External Reference and linking with workbooks
    By ervarunkant in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-12-2014, 07:16 AM
  3. Referencing external workbooks
    By cptwhite1 in forum Excel General
    Replies: 2
    Last Post: 06-07-2014, 09:37 AM
  4. Replies: 3
    Last Post: 05-13-2009, 11:51 PM
  5. Replies: 2
    Last Post: 05-01-2009, 07:06 PM
  6. how to query several external workbooks?
    By chemoul in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-13-2007, 12:55 AM
  7. Links to external workbooks
    By grime in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-01-2005, 01:07 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