DGET Function + External data from another excel file

N

Nader

Hello,

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)
?

thanks in advance !

Nader
 
H

Harlan Grove

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.
 
G

Guest

It looks like it is missing the worksheet name, something like:
DGET ('c:\tmp\[tmp_excel.xls]Sheet1'!A1:D20;"ID";A1:A2)
If the sheet is not called Sheet1, change as required

Hope this helps,
Miguel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top