Getting values from a closed file

  • Thread starter Thread starter Shelley
  • Start date Start date
S

Shelley

Hi, I'm designing a userform with a drop down list. Based
on the value the user chooses, I need to get values out of
several cells in a closed workbook and populate them into
another workbook. How can this be done? I was told you
cannot get any information out of a closed workbook using
VB.
 
The easiest is to open the workbook and grab the values, then close it.

Second easiest is to build a linking formula in a cell, grab the returned
value, clear the cell

Range("A1").Formula = "=C:\Myfolder[mybook.xls]Sheet1!B9"
vVal = Range("A1").Value
Range("A1").Clear
 
Hi Tom, do I actually code the "[" and "]"?
Thanks
-----Original Message-----
The easiest is to open the workbook and grab the values, then close it.

Second easiest is to build a linking formula in a cell, grab the returned
value, clear the cell

Range("A1").Formula = "=C:\Myfolder[mybook.xls]Sheet1!B9"
vVal = Range("A1").Value
Range("A1").Clear


--
Regards,
Tom Ogilvy


Hi, I'm designing a userform with a drop down list. Based
on the value the user chooses, I need to get values out of
several cells in a closed workbook and populate them into
another workbook. How can this be done? I was told you
cannot get any information out of a closed workbook using
VB.


.
 
Back
Top