+ Reply to Thread
Results 1 to 6 of 6

sum(offset(... to linked file requires linked file to be open?

  1. #1
    Valued Forum Contributor
    Join Date
    11-15-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    538

    sum(offset(... to linked file requires linked file to be open?

    I have mywB.xls and linkedwB.xls.
    I changed
    =sum(linkedwb!B1:e1)
    to
    =sum(offset(linkedwb!B1,0,0,1,4)

    But now when I open mywB, even if I say don't update links, I get a bunch of #VALUE if linkedwB is not already open. The linked cells work fine when I open linkedwB. Before it was fine, whether linkedWB open or not, and whether I said update or not.

    This is awful. I can't even open myWB and print it without opening all of numerous linked files that I use SUM(OFFSET( on.

    I have a theory that the volatile function OFFSET is to blame. I'm using those 4th and 5th args of offset and SUM, but my experimentation suggests that I could go
    =sum(index(linkedwb!B1:E1,0,0)
    I didn't know index would do that but apparently it does. I thought at very least I'd need to go
    =sum(index(linkedwb!B1,0,0):index(linkedwb!e1,0,0))
    By the way, that one also seems to work too. Both work fine with linkedWB closed.

    So is the story here to stay away from volatile functions with a link? That would make sense; otherwise, he'd be updating the link of the close file (the SLOOOOW thing) every time I touched any cell, volatile or not ... or at least he'd be nagging me every time. Right?

    XL03
    Chip, if you can read this, you're STILL making the world a better place with your immeasurably valuable gifts. Every week, you continue to help me (and untold numbers of others) tremendously. Practically no alternative outlets can match your effectiveness, even over the vast number of topics you demystify and empower usage of. You were, and still are, amazing.

  2. #2
    Valued Forum Contributor
    Join Date
    11-15-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    538

    Re: sum(offset(... to linked file requires linked file to be open?

    More info: I really want OFFSET, because after
    =sum(index(linkedwb!B1:E1,0,0)
    I'll want
    =sum(index(linkedwb!F1:I1,0,0)
    then
    =sum(index(linkedwb!J1:M1,0,0)
    etc.
    Since each is 4 columns past the previous, OFFSET was great. But I can't get away with generalizing this on INDEX, right?

    Maybe I could use INDIRECT - though I abhor it, as it's to a degree hardcoding, and it thwarts. dependency traces.
    C10="B"
    C11=CHAR(CODE(C10)+3)
    C11 would be "E" and
    sum(index(linkedwb!INDIRECT...
    Man, that's a lot of hooey to do something so simple!

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

    Re: sum(offset(... to linked file requires linked file to be open?

    There are several functions that don't work with closed workbooks... volatile and not volatile.

    E.g. SUMIF and COUNTIF don't work, as well as OFFSET and INDIRECT...
    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.

  4. #4
    Valued Forum Contributor
    Join Date
    11-15-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    538

    Re: sum(offset(... to linked file requires linked file to be open?

    Thank you for a clear specific answer. Well, has anyone used Harlan Grove's PULL() function? It is a slow workaround for using INDIRECT on a closed file
    http://numbermonger.com/2012/02/11/e...sed-workbooks/
    Harlan's 2012 updated addin: http://www.4shared.com/file/L_eA8s4G/pull.html
    Or any other alternatives?

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

    Re: sum(offset(... to linked file requires linked file to be open?

    There is a Free Addin here: http://download.cnet.com/Morefunc/30...-10423159.html called Morefunc, that uses INDIRECT.EXT to pull from closed workbooks.

  6. #6
    Valued Forum Contributor
    Join Date
    11-15-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    538

    Re: sum(offset(... to linked file requires linked file to be open?

    I truly apologize; all of a sudden I'm finding all kinds of links on the topic that my crappy googling failed to yield before I posted ... including the very same answer from NBVC a year ago. Sorry! Anyway it had a great WhyDidntIThinkOfThat solution, to do the summing in the linkedWB.xls, and do the offsets there too, so I can read contiguously. Doooh!!

    Thanks for the morefunc answer, and your continued polite assistance. Other ideas follow if anyone wants to explore, either now or you future Googlers. I'll stop monitoring here though. NBVC you've got my mind thinking straight now.
    J. Walk's "A VBA Function To Get A Value From A Closed File" http://spreadsheetpage.com/index.php...a_closed_file/
    DailyDick's "INDIRECT and closed workbooks:" http://www.dailydoseofexcel.com/arch...sed-workbooks/
    (Jeez, without Daily the forum blotted out "Richard"'s name!)
    Ron DeBruin's "Copy a range from closed workbooks (ADO)": http://www.rondebruin.nl/ado.htm

+ 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