External Reference

  • Thread starter Thread starter leon22
  • Start date Start date
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
 
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!)
 
Hi Dave,

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

Thank
 

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

Back
Top