ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ACCESSING closed files (https://www.excelbanter.com/excel-programming/402251-accessing-closed-files.html)

Berj

ACCESSING closed files
 
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.


John

ACCESSING closed files
 
See Ron de Bruin's site:
http://www.rondebruin.nl/ado.htm
--
JB


"Berj" wrote:

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.


Gary''s Student

ACCESSING closed files
 
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
--
Gary''s Student - gsnu200760


"john" wrote:

See Ron de Bruin's site:
http://www.rondebruin.nl/ado.htm
--
JB


"Berj" wrote:

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.



All times are GMT +1. The time now is 06:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com