+ Reply to Thread
Results 1 to 17 of 17

Importing a range of data from a closed workbook

  1. #1
    Registered User
    Join Date
    04-19-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    50

    Importing a range of data from a closed workbook

    Hi,

    Due to some cutbacks the company I work for has taken away the database system we used to use to record debts owed to us, so I'm building one in excel (no access or sql otherwise I'd use those). We have all the debt in seperate workbooks by financial period and I'm creating a new workbook that will upon entering of a specific financial period will pull information from the pertaining workbook and report on the information.

    I have a Formula

    =INDIRECT.EXT(CONCATENATE("'C:\Documents and Settings\hughel13\My Documents\[",Reports!$C$11,".xls]Sheet1'!R2:R138"))

    Among others which pull other ranges

    Which as I understand should work just fine on a closed workbook, however it only works when the target workbook is open.
    When the workbook is closed the formula only pulls the first value in the range.

    On a related note the above formula and it's counterparts are autofilled down the page from 2 to 1000 as some of the workbooks have 1000 records to pull, however the ones that dont have that many, cause errors when the data is pulled, is there a way to make it so that if the cell it's pulling from is empty it doesn't pull from it or pulls a value of 0?

    Any ideas?
    Last edited by sigfreid; 09-16-2009 at 03:45 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Importing a range of data from a closed workbook

    It should work, yes...

    as a test, does this alternate work?


    =INDIRECT.EXT("'C:\Documents and Settings\hughel13\My Documents\["&Reports!$C$11&".xls]Sheet1'!R2:R138"))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    04-19-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Importing a range of data from a closed workbook

    Nope that doesn't work properly either, only pulls the first value in the range.

    Incidently this works perfectly with the workbook open or closed

    ='C:\Documents and Settings\hughel13\My Documents\[2009-2010.xls]Sheet1'!R2:R138

    However

    ="'C:\Documents and Settings\hughel13\My Documents\["&Reports!$C$11&".xls]Sheet1'!R2:R138"

    =Concatenate("'C:\Documents and Settings\hughel13\My Documents\["&Reports!$C$11&".xls]Sheet1'!R2:R138")

    =Indirect(Concatenate("'C:\Documents and Settings\hughel13\My Documents\["&Reports!$C$11&".xls]Sheet1'!R2:R138"))

    =Indirect.ext(Concatenate("'C:\Documents and Settings\hughel13\My Documents\["&Reports!$C$11&".xls]Sheet1'!R2:R138"))

    =Indirect.ext("'C:\Documents and Settings\hughel13\My Documents\["&Reports!$C$11&".xls]Sheet1'!R2:R138"))

    All do not work.
    Last edited by sigfreid; 09-09-2009 at 08:39 AM.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Importing a range of data from a closed workbook

    I can't exactly see why it does not work... the formula looks ok....

    Do you have the latest version of Morefunc.xll installed?

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Importing a range of data from a closed workbook

    Does this one work with workbook open?

    =Indirect(Concatenate("'C:\Documents and Settings\hughel13\My Documents\["&Reports!$C$11&".xls]Sheet1'!R2:R138"))

    What errors are you getting?

    Are you sure cell Reports!$C$11 contains exactly matching text as the sheet name you want to link to.. check for spaces, etc...

  6. #6
    Registered User
    Join Date
    04-19-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Importing a range of data from a closed workbook

    I have version 5.06, I believe that's the latest version, and yes I'm sure it matches exactly it finds the file just fine and even manages to pull data, but if the workbook is closed it will only pull the very first record in the range, for example;

    with the workbook open when I run the formula I get

    2
    3
    4
    5
    6

    with it closed I get

    2
    2
    2
    2
    2

    =Indirect(Concatenate("'C:\Documents and Settings\hughel13\My Documents\["&Reports!$C$11&".xls]Sheet1'!R2:R138"))

    Does work perfectly when the workbook is open.

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Importing a range of data from a closed workbook

    What exactly is that formula supposed to do anyways?

    all it is doing is referencing a range... but there is not manipulation or calculations.. and unless you enter it as an array formula, it should only extract the first value.. in the range... ie...Sheet1'!R2

  8. #8
    Registered User
    Join Date
    04-19-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Importing a range of data from a closed workbook

    I'm creating reports using the data, using SUM IF and COUNT IF as an array. These proved extremely difficult to use when trying to perform them on data in another workbook, so I made a second hidden page that pulls all the relevant information from the target workbook and all the manipulation and calculation happens on that local copy.

    I'll attatch copies of the workbooks if that would help, will take a little while tho as I'll have to create fake data as it's somewhat sensitive information.

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Importing a range of data from a closed workbook

    Quote Originally Posted by sigfreid View Post
    I'll attatch copies of the workbooks if that would help, will take a little while tho as I'll have to create fake data as it's somewhat sensitive information.
    I think that's the best thing to do...

  10. #10
    Registered User
    Join Date
    04-19-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Importing a range of data from a closed workbook

    Can't seem to upload the copies I get a "databse error" from the website O.o

    Edit: they were too large about 4mb total, so I did zip them to about 1.2mb and still got an error, trying again tho.

    Edit2: Still getting an error >.<, possibly because I'm at work, I'm home in around 2 hours I'll try again then.
    Last edited by sigfreid; 09-09-2009 at 10:09 AM.

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Importing a range of data from a closed workbook

    Maybe too large... try zipping them...

  12. #12
    Registered User
    Join Date
    04-19-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Importing a range of data from a closed workbook

    Got them to upload!
    Attached Files Attached Files

  13. #13
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Importing a range of data from a closed workbook

    I got it to work, obviously having to change path to my directories...

    Try:

    =INDIRECT.EXT("'C:\Documents and Settings\hughel13\My Documents\["&Reports!$C$11&".xls]Sheet1'!$R"&ROW($A2))

    Copied Down

  14. #14
    Registered User
    Join Date
    04-19-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Importing a range of data from a closed workbook

    Brilliant, that's exactly it! Is there anyway to speed it up do you know? I'm using it for 3 columns each 750 rows down and it takes a good 30+ seconds to calculate it, whereas if the target workbook is open it's pretty much instant, it's also instant if I set an absolute file name rather than a concatenated one, which seems odd because the other extra work it has to do as far as I can tell is putting the text together. Or is this an unavoidable limtiation of working with data from a closed workbook?

  15. #15
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Importing a range of data from a closed workbook

    You can add the FALSE parameter allowed for making the function non-Volatile:



    =INDIRECT.EXT("'C:\Documents and Settings\hughel13\My Documents\["&Reports!$C$11&".xls]Sheet1'!$R"&ROW($A2),FALSE)

    per Indirect.Ext help: hit Ctrl-Alt-F9 to update the results

  16. #16
    Registered User
    Join Date
    07-19-2013
    Location
    United Kingdom
    MS-Off Ver
    Office 2007
    Posts
    89

    Re: Importing a range of data from a closed workbook

    Sorry to jack into this.

    I see how it works I just dont understand it! Im looking to do something similar. I just do not understand how that formula knows to pull from 2009-2010 mock?!

    Confused as hell.com

  17. #17
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Importing a range of data from a closed workbook

    Please start another thread and link to this one if necessary for reference.

    The formula is using the value in Reports sheet, cell C11 to get the workbook it needs to search, and in that workbook it will go to sheet1, column R and row determined by ROW($A2) which results to 2, so Sheet1!R2 to get the info it needs.

+ 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