1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| 'variables pour excel
Dim appXls As xls.Application
Dim sheet As xls.Worksheet
appXls = New xls.Application
appXls.Visible = False
appXls.Workbooks.Open("C:\Users\Kamikazoide\Dropbox\Applications\SCANPET\SuperMarc_20180106_1936.xls")
sheet = CType(appXls.ActiveWorkbook.Worksheets("Data"), xls.Worksheet)
'sheet.Application.Calculation = Microsoft.Office.Interop.Excel.XlCalculation.xlCalculationManual
For i = 2 To sheet.UsedRange.Rows.Count
If Not sheet.Cells(i, "A").Value.ToString = "" Then
Dim CodeBarre As String = sheet.Cells(i, "A").Value
Dim Jour() As String = sheet.Cells(i, "B").Value
Dim Heure() As String = sheet.Cells(i, "C").Value
Me.CU_Refre.REFRE_LV_CodeB.Items.Add(sheet.Cells(i, "A").Value)
End If
Next
appXls.Quit() |