Uipath 작업 Excel

2008 단어 UiPath
1. 공통 작업
1) Excel Application Scope로 excel을 읽고 데이터테이블을 조작한다.
2) 수동으로 dt(고정 헤더 가능)를 새로 만들고 dt의 삭제 필터를 한 다음 excel에 쓰기;
 
2.Net Write, inokeCode로 excel 조작
1) 텍스트는 xaml 파일을 열고,
a. 탭 아래에 Microsoft를 삽입합니다.Office.Interop.Excel
b. 탭 아래에 Microsoft를 삽입합니다.Office.Interop.Excel
2) invoke에서 진행합니다.net 코드 작업
 'Dim xlApp As Microsoft.Office.Interop.Excel.Application = Nothing
 Dim xlWorkBooks As Microsoft.Office.Interop.Excel.Workbooks=Nothing
 'Dim xlWorkBook As  Microsoft.Office.Interop.Excel.Workbook=Nothing
 Dim xlWorkSheet As Microsoft.Office.Interop.Excel.Worksheet=Nothing
 Dim xlWorkSheets As Microsoft.Office.Interop.Excel.Sheets=Nothing
 Dim rowcount As Integer
 Dim colcount As Integer
 
 xlApp=New Microsoft.Office.Interop.Excel.ApplicationClass
 xlApp.DisplayAlerts=False // 
 xlWorkBooks=xlApp.Workbooks
 xlWorkBook=xlWorkBooks.Open(filePath)
 xlApp.Visible = True // 
 xlWorkSheets=xlWorkBook.Sheets
 

'xlWorkBook.Save()

'xlApp.Quit()
 Dim xlApp As Microsoft.Office.Interop.Excel.Application = Nothing
 Dim xlWorkBooks As Microsoft.Office.Interop.Excel.Workbooks=Nothing
 Dim xlWorkBook As  Microsoft.Office.Interop.Excel.Workbook=Nothing
 Dim xlWorkSheet As Microsoft.Office.Interop.Excel.Worksheet=Nothing
 Dim xlWorkSheets As Microsoft.Office.Interop.Excel.Sheets=Nothing
 
 xlApp=New Microsoft.Office.Interop.Excel.ApplicationClass
 xlApp.DisplayAlerts=False
 xlWorkBooks=xlApp.Workbooks
 xlWorkBook=xlWorkBooks.Open(filePath)
 xlApp.Visible = False
 xlWorkSheets=xlWorkBook.Sheets
 
xlWorkSheet= CType(xlWorkSheets(1),Microsoft.Office.Interop.Excel.Worksheet)


# 
Try
    Dim range As Microsoft.Office.Interop.Excel.Range = xlWorkSheet.Range("A1:A"&rows)
    Dim entireRow As Microsoft.Office.Interop.Excel.Range = range.EntireRow
    entireRow.Delete(Microsoft.Office.Interop.Excel.XlDirection.xlUp)
    xlWorkBook.Save()
Catch ex As Exception
Finally
    xlApp.Quit()
End Try

좋은 웹페이지 즐겨찾기