Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
reference to an external file Alberto Ast[_2_] Excel Discussion (Misc queries) 6 October 19th 09 05:46 PM
External xls reference error Fluke[_2_] Excel Worksheet Functions 1 May 22nd 09 10:14 AM
External reference not working? Todd Lietha Excel Discussion (Misc queries) 5 September 21st 07 09:36 PM
External Reference Iain Excel Discussion (Misc queries) 3 February 8th 05 06:53 PM
External reference as a condition Ingeniero1 Excel Worksheet Functions 0 November 12th 04 09:42 PM


All times are GMT +1. The time now is 10:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"