2016. 9. 9. 11:15ㆍIT/MS-SQL
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 lColumn As Long = 0
xWorkbook = xls.Workbooks.Open("E:\1234512345.xls") 'File Location
xWorksheet = xWorkbook.Sheets(1)
With xWorksheet
If xls.WorksheetFunction.CountA(.Columns) <> 0 Then
lColumn = .Columns.Find(What:="*", _
After:=.Range("A1"), _
LookAt:=Excel.XlLookAt.xlPart, _
LookIn:=Excel.XlFindLookIn.xlFormulas, _
SearchOrder:=Excel.XlSearchOrder.xlByColumns, _
SearchDirection:=Excel.XlSearchDirection.xlPrevious, _
MatchCase:=False).Column
Else
lColumn = 1
End If
End With
MessageBox.Show(lColumn) 'Find Last Column
xWorkbook.Close()
xls.Quit()
'IT > MS-SQL ' 카테고리의 다른 글
[MSSQL] Table 복사 / MSSQL 테이블 복사 / MSSQL Table 백업 / MSSQL 테이블 백업 (0) | 2016.09.21 |
---|---|
[MSSQL] HAVING 절 중복체크 (0) | 2016.09.21 |
PB11.5 , POWERBUILDER 11.5 , SQLSTATE ERROR 22005 (0) | 2016.08.24 |
[MS-SQL] ROW 값 나열하기, 세로 값을 가로 값으로 나열하기 (0) | 2016.08.24 |
MSSQL, LEFT, RIGHT, SUBSTRING, LEN (0) | 2016.08.16 |