View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove Harlan Grove is offline
external usenet poster
 
Posts: 733
Default DGET Function + External data from another excel file

Nader wrote...
I'm trying to use the function DGET and get data from another excel
worksheets and it doesn't seems to work.

Does this looks correct : DGET ('c:\tmp\[tmp_excel.xls]'!A1:D20;"ID";A1:A2)


You should state how it doesn't work.

In this case, there are two problems. First, there's a syntax error.
Your external reference is either missing a worksheet name before the
exclamation point, or if the file has a single worksheet named
tmp_excel then you shouldn't have the square brackets around the base
filename. Second, DGET's first argument must be a range reference.
Excel doesn't consider references into closed workbooks to be range
references. That means you can't use DGET (or any of the other D...
functions) to refer to blocks of cells in other workbooks that could be
closed.

There are workarounds, but you'll need to provide the A1:D1 values
(field names) from the other file and the contents of the criteria
range.