VLOOKUP into a closed xls using VBA

A

alk1000

Hi there,

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

Cheers
AnA

"Hello --

Can someone show me the format for using VLOOKUP in VBA to get a valu
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
 
T

Tom Ogilvy

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.
 

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