or maybe the simple and very standard
='C:\[test.xls]Sheet1'!A1
he didn't say he wanted it to be dynamic.
--
Regards,
Tom Ogilvy
That works from VBA, but not when called from a worksheet.
But Harlan Grove posted a function that opens the other workbook and
retrieves
the value from a separate instance of excel:
http://google.com/[email protected]
Gromit wrote:
Hi Jim,
I did a search on Google and turned up the following code written by
John Walkenbach, apparently designed to solve my problem. However, I
still can't get this to work. Is it me, or am I really barking up the
wrong tree here? I'm using Excel 2000 on Win 2000.
Thanks,
Graham
Function GetValue(path, file, sheet, range_ref)
' Retrieves a value from a closed workbook
Dim arg As String
' Make sure the file exists
If Right(path, 1) <> "\" Then path = path & "\"
If Dir(path & file) = "" Then
GetValue = "File Not Found"
Exit Function
End If
' Create the argument
arg = "'" & path & "[" & file & "]" & sheet & "'!" & _
Range(range_ref).Range("A1").Address(, , xlR1C1)
' Execute an XLM macro
GetValue = ExecuteExcel4Macro(arg)
End Function