ACCESSING closed files

  • Thread starter Thread starter Berj
  • Start date Start date
B

Berj

Hi All,

Is there a command which I can add at the beginning of a macro so
that it can access the data in other Excel files without opening them?

Thanks.
 
You can have VBA do the same thing a user can do on the worksheet. Say we
want to get the value in cell A1 in sheet b in file b.xls in folder c:\temp2

Pick a helper cell (say Z100) and:

Sub dumpit()
Dim s As String
s = "='C:\temp2\[b.xls]b'!$A$1"
Range("Z100").Formula = s
End Sub
 

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