View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default VLOOKUP into a closed xls using VBA

VBA doesn't support going to closed workbooks.

Workarounds include opening the workbook, using an xl4 macro command, using
a database query with ADO or DAO. The fastest is putting your formula in a
cell, then collecting the returned value and clearing the cell.

--
Regards,
Tom Ogilvy



"alk1000" wrote in message
...

Hi there,

This thread was posted by Larry Mehl in Excel Charting forum by mistake
so he
didn't get any replies. As i'm after the same thing exactly , i thouhgt
to repost the
same question.

Cheers
AnA

"Hello --

Can someone show me the format for using VLOOKUP in VBA to get a value
from
a closed xls file?

In a worksheet
=VLOOKUP(1,TA_TestScript.xls!TestCases,2,FALSE)

TA_TestScript.xls is the closed file

works, but I can't figure out the correct combination of [ ], " ", etc.
to
make it work in VBA.

Thanks for any help.

Larry Mehl"


--
alk1000
------------------------------------------------------------------------
alk1000's Profile:

http://www.excelforum.com/member.php...o&userid=14970
View this thread: http://www.excelforum.com/showthread...hreadid=265960