+ Reply to Thread
Results 1 to 3 of 3

Lookup in other workbook goes #REF! when closed

  1. #1
    Registered User
    Join Date
    11-24-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    15

    Lookup in other workbook goes #REF! when closed

    Hi


    im trying to do a lookup in a list found in other workbook.


    The workbookname is a variable, in this example "Test3720.xlsm"

    When i write the function with the workbookname "hardtyped", it work fine, with the searched woorkbook both opened and closed... the code goes like this

    Please Login or Register  to view this content.

    But when i try to replace the workbookname with a variable found in a cell (the "Test3720" part of the string), like this

    Please Login or Register  to view this content.
    (the value of cell C4 is ofc "Test3720"), then it all of a sudden works fine when the workbook "Test3720.xlsm" is open... but when closed the return of my function turns to #REF !



    Why is that?? Any1 that knows? And anything i can do to make the function also work so it can search data in closed workbooks??


    Best regards


    Kasper

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,825

    Re: Lookup in other workbook goes #REF! when closed

    As explained in the help file for the INDIRECT() function (https://support.office.com/en-us/art...1-92b6306fa261 ):
    If ref_text refers to another workbook (an external reference), the other workbook must be open. If the source workbook is not open, INDIRECT returns the #REF! error value.
    If your query must work on closed workbooks, then you will need to do something different. I am not familiar with this kind of work, so I cannot suggest anything specific. You may want to explain exactly what you are doing, how the INDIRECT() part of the function is important, why it is important for the workbook to stay closed, and anything else that may help us understand the context for this task. My impression is that there are many different approaches to this kind of lookup problem, and it could be important to understand exactly how this lookup fits into the overall flow of data.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    11-24-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Lookup in other workbook goes #REF! when closed

    Thank you for the reply.

    Fortunatly, i am sort of setting up the data-flow at the same time that im doing the needed spreadsheets... so i am going to go around this problem by changing the dataflow to fit the spreadsheets in stead


    best regards

    Kasper

+ 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. [SOLVED] using Lookup to get values from external workbook, open or closed.
    By JaimeP in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-06-2017, 08:54 AM
  2. Export data with two Criteria values from closed workbook to closed workbooks VBA
    By julielara in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2016, 01:56 PM
  3. Please help!!! Macro program to lookup values from a closed workbook
    By kaetz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-04-2015, 03:39 PM
  4. Replies: 0
    Last Post: 03-27-2014, 12:38 PM
  5. Lookup closed workbook from UserForm
    By jagman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-18-2012, 04:00 PM
  6. Replies: 8
    Last Post: 09-15-2011, 07:31 PM
  7. Lookup in closed workbook
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-24-2010, 04:12 PM

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