Reading information from a closed workbook

  • Thread starter Thread starter yhockman1
  • Start date Start date
Y

yhockman1

Hi

I need to run a VBA program that reads information from a second excel
workbook.

Is it possible to extract this information while the second workbook is
closed?

Thanks
 
the best answer would depend a lot on the specifics. However, the fastest
way is to put a linking formula in a worksheet and retrieve the information

ActiveCell.Formula = "='C:\My Folder\[Myfile.xls]Sheet1'!A1"
' No replace the formula with the value returned
ActiveCell.Formula = ActiveCell.Value

you can do multiple cells this way with one command

with ActiveCell.Resize(50,10)
.Formula = "='C:\My Folder\[Myfile.xls]Sheet1'!A1"
.Formula = .Value
End with

If the data is organized like a Database, you can use ADO


http://www.erlandsendata.no/english/index.php?t=envbadac
 

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