Well for that you would probably be better off looking in an Excel group for
a comprehensive macro that dealt with all situations (e.g whether or not the
sheet is closed, error handling etc.) but for example you could
a. set a reference to Microsoft Excel 11.0 Object Library (or whichever
version is appropriate)
b. use a function such as
Function getcellvalue(strWBPath As String, _
strWSname As String, _
lngRow As Long, _
lngColumn As Long)
Dim objExcel As Excel.Application
Dim objWB As Excel.Workbook
Dim objWS As Excel.Worksheet
Set objExcel = CreateObject("Excel.Application")
With objExcel
Set objWB = .Workbooks.Open(FileName:=strWBPath, ReadOnly:=True)
Set objWS = objWB.Worksheets(strWSname)
getcellvalue = objWS.Cells(lngRow, lngColumn).Value
Set objWS = Nothing
objWB.Close savechanges:=False
Set objWB = Nothing
End With
objExcel.Quit
Set objExcel = Nothing
End Function
c. call it using e.g.
msgbox getcellvalue("c:\myxlwbs\myxlwb.xls","mysheetname",23,3)
to get the value of row 23 column C
Peter Jamieson