View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default import =[test.xls]Sheet1!A1 - help

The function you'd want to use that's built into excel is =indirect(). But that
function returns an error if the sending workbook is closed.

Laurent Longre has an addin (morefunc.xll) at:
http://xcell05.free.fr/

That includes =indirect.ext() that may help you.

========
Try opening "Test 01-05-2008.xls" first (easier to test).

Then in a worksheet in a different workbook, put the date in A1.

Then try this:
=INDIRECT("'[test " & TEXT(A1,"mm-dd-yyyy") & ".xls]sheet1'!A1")

(is 01-05-2008 January 5, 2008 or May 1, 2008???? Change that =text() format
the way you need).

After you have that working, you can try using =indirect.ext(). You'll have to
add the drive/path, so that it looks something like:

=INDIRECT.ext("'c:\excel\[test " & TEXT(A1,"mm-dd-yyyy") & ".xls]sheet1'!A1")

But that's a guess. I don't use that addin.

But lots of people do. If you have trouble getting it to work, post back with
the drive/folder name and what you've tried. I'll bet you get help!

AMaleThing wrote:

I'm importing data from .xls reports created each day. The file will
include the date.

Is it possible the file is called "Test 01-05-2008.xls", I could
create a string something like:

=[test +"A3"+ .xls]Sheet1!A1 // Where A3 is 01-05-2008

Help appreciated.


--

Dave Peterson