2016. 7. 21. 16:01ㆍIT/Visual Basic (.Net)
Dim xls As New Excel.Application
Dim xWorkbook As Excel.Workbook
Dim xWorksheet As Excel.Worksheet
Dim xRange As Excel.Range
Dim xlotno As String
Dim lRow As Long = 0
xWorkbook = xls.Workbooks.Open("E:\1234512345.xls") 'File Location
xWorksheet = xWorkbook.Sheets(1)
With xWorksheet
If xls.WorksheetFunction.CountA(.Cells) <> 0 Then
lRow = .Cells.Find(What:="*", _
After:=.Range("A1"), _
LookAt:=Excel.XlLookAt.xlPart, _
LookIn:=Excel.XlFindLookIn.xlFormulas, _
SearchOrder:=Excel.XlSearchOrder.xlByRows, _
SearchDirection:=Excel.XlSearchDirection.xlPrevious, _
MatchCase:=False).Row
Else
lRow = 1
End If
End With
MessageBox.Show(lRow) 'Find Last Row
xWorkbook.Close()
xls.Quit()
'IT > Visual Basic (.Net)' 카테고리의 다른 글
[VB.NET] MS-SQL TABLE SELECT INERT UPDATE (0) | 2018.03.12 |
---|---|
[VB.NET] SQL 연결하기, DB 연결하기, Database 연결 (0) | 2018.03.12 |
[VB.NET] Print List 가져오는 방법, 프린트 설정 [PrintDialog] (0) | 2017.03.29 |
VB.NET EXCEL Read, Write / VB.NET 엑셀 읽고, 쓰기 (0) | 2016.07.20 |
[Visual Basic] 문자열 함수, 문자열함수, format, string (0) | 2016.07.04 |