External Reference

L

leon22

Hi,

I am currently designing a vbmacro, and I am trying to find out how t
retrieve in a VB variable the cell content of a closed excel file.

For instance, I want the VB variable "cell_content" to retreive th
string "Total" contained in cell "A1" of the closed workshee
"TEST.XLS".

Any help would be greatly appreciated.

Thank
 
D

Dave Peterson

You could plop a formula in an unused cell to retrieve the value.

or you could use a technique on John Walkenbach's site:

http://j-walk.com/ss/excel/eee/eee009.txt
Look for either: GetDataFromClosedFile or GetValue.




But if you really want to just retrieve the string Total, why not just assign it
to your variable:

dim cell_content as string
cell_content = "Total"

Yeah, yeah. (It was a feeble attempt at humor!)
 
L

leon22

Hi Dave,

As you suggested, I used John Walkenbach's method (e.g.
GetDataFromClosedFile ) and it works just fine.

Thank
 
Top