View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Mona Mona is offline
external usenet poster
 
Posts: 69
Default !

I wanted to retrieve data from close file.

Thank you!

"Dave Peterson" wrote:

You mean to retrieve values from cells on a worksheet?

You can use helper cells in a worksheet and build formulas to do the work

or

You could retrieve values from a closed workbook using a routine from John
Walkenbach:
http://j-walk.com/ss/excel/eee/eee009.txt
Look for either: GetDataFromClosedFile or GetValue.

Mona wrote:

I will be accessing several workbooks (test.xls, test1.xls, ...).

What is the syntax to "reference" workbook without having to open it?

thanks
-Mona

Set wbkTarget = Workbooks.open(Filename:="c:\ test.xls")
If wbkTarget Is Nothing Then
MsgBox "Can not open file"
Else
Set wksTarget = wbkTarget.Sheets("Summary")
If wksTarget Is Nothing Then
MsgBox "Could not locate sheet"
Else
lRow_2006 = Sheets("Summary").Range("A" & _
Sheets("Summary").Rows.count).End(xlUp).Row
End If
End If


--

Dave Peterson