vsto outlook addin에서 Excel 시트의 마지막 빈 셀을 어떻게 검색합니까?vsto - VB - Outlook addin의 열에서 마지막 셀 찾기
나는 스콧 Holtzman의 의견에 따라 내가 업데이트 한 다음 코드 (컴파일되지 않음)
Imports Excel = Microsoft.Office.Interop.Excel
Dim ExcelApp As New Excel.Application
Dim ExcelWorkbook As Excel.Workbook
Dim ExcelWorkSheet As Excel.Worksheet= ExcelWorkbook.Worksheets(1)
Dim ExcelRange As Excel.Range = ExcelWorkSheet.Range("A1","A600")
Dim currentFind As Excel.Range = Nothing
Dim firstFind As Excel.Range = Nothing
currentFind = ExcelRange.Find("*", , Excel.XlFindLookIn.xlValues, Excel.XlLookAt.xlPart, Excel.XlSearchOrder.xlByRows, Excel.XlSearchDirection.xlNext, False)
While Not currentFind Is Nothing
' Keep track of the first range you find.
If firstFind Is Nothing Then
firstFind = currentFind
' If you didn't move to a new range, you are done.
ElseIf currentFind.Address = firstFind.Address Then
Exit While
End If
currentFind = ExcelRange.FindNext(currentFind)
End While
ExcelWorkbook.ActiveSheet.range(currentFind).Select()
을 가지고 있지만 지금은 오류 메시지가 : HRESULT : 0x800A03EC
솔루션을 질문의 업데이트가 아닌 답변으로 게시하십시오. 이것은 미래 방문자에 대한 혼란을 피하기위한 것입니다. 변경 사항은 정확히 손실되지 않으며 [수정본] (https://stackoverflow.com/posts/46711104/revisions)에서 변경 사항을 가져올 수 있습니다. – Bugs