ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   external reference (https://www.excelbanter.com/excel-programming/296201-external-reference.html)

Paul Levy

external reference
 
I am using Excel 5. (Don't laugh). I am trying to set a variable in a module
in one workbook by referencing a cell in another workbook (that contains
some data). How can I do this? I tried the following and it failed.

Sub test()
Dim j As Variant

j = Evaluate("[temp.xls]sheet1!R23C4")
End Sub

this gives me an error 2015
Any help is appreciated.
Thanks,
Paul



Dave Peterson[_3_]

external reference
 
how about just retrieving that value directly:

dim j as variant
j = workbooks("temp.xls").worksheets("sheet1").range(" D23").value





Paul Levy wrote:

I am using Excel 5. (Don't laugh). I am trying to set a variable in a module
in one workbook by referencing a cell in another workbook (that contains
some data). How can I do this? I tried the following and it failed.

Sub test()
Dim j As Variant

j = Evaluate("[temp.xls]sheet1!R23C4")
End Sub

this gives me an error 2015
Any help is appreciated.
Thanks,
Paul


--

Dave Peterson



All times are GMT +1. The time now is 08:42 AM.

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