+ Reply to Thread
Results 1 to 3 of 3

reading contents of a file without opening the file using INDIRECT function

  1. #1
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    reading contents of a file without opening the file using INDIRECT function

    I have 2 files A.xlsx and B.xlsm. File A is simply a data file that file B uses. File is A is quite large and I would rather have file B read A's select contents without opening A (plus I have quite of a bit of A's in my real application). Generally, excel does this pretty easily if I specify the entire path to the A file like this: ='C:\Desktop\[A.xlsx]Sheet1'!A1.

    What I'd like to do is use the INDIRECT function so I can refer to different areas of A realtively easily, but when trying to use this function (here's a simple example =INDIRECT("'C:\Desktop\[A.xlsx]Sheet1'!A1") or =INDIRECT("'C:\Desktop\[A.xlsx]Sheet1'!A"&row_number), I get a #REF! error. Any idea how to do this so it works? Or is there another way to do what I am after without using INDIRECT? All I need to be able to do is keep the data file closed while being able to control what area of the data file B.xlsm reads, which is what I am able to do with INDIRECT.

    Thank you.
    Last edited by luv2glyd; 03-22-2013 at 01:59 PM.
    You either quit or become really good at it. There are no other choices.

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

    Re: reading contents of a file without opening the file using INDIRECT function

    as you have found out indirect along with some others does not work with closed workbooks
    you could try indirect.ext which is in the morefunc add-in

    http://www.brothersoft.com/morefunc-294497.html
    "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

  3. #3
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: reading contents of a file without opening the file using INDIRECT function

    OK, thanks. I'll have to work around this somehow.

+ 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