|
-
Apr 29th, 2013, 09:22 AM
#9
Re: read sheet 2 in an excel file
 Originally Posted by rjhe22
hi
would this work
Code:
Dim App1 As Object
App1 = CreateObject("Excel.Application")
' load excel document
App1.Workbooks.Open(txtFileName.Text)
Dim Sheet1 As Worksheet
' Dim Sheet2 As Worksheet
Sheet1 = App1.Workbooks(1).Worksheets(5)
Dim r As Excel.Range
r = Sheet1.Cells.Find("Total Cash Funds", , _
Excel.XlFindLookIn.xlValues, Excel.XlLookAt.xlPart, _
Excel.XlSearchOrder.xlByRows, Excel.XlSearchDirection.xlNext, False)
' a = Sheet1.("Total Cash Funds").Value.ToString
' Sheet2 = App1.Workbooks(1).Worksheets(6)
' b = Sheet2.Range("E3").Value.ToString
End Sub
Try it, this will tell you if it works.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|