1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim numRows, numRowsBis As Integer
xlApp = New Excel.ApplicationClass
' pour ouvrir le fichier EXCEL en attribut le chemin où ce trouve le fichier'
xlWorkBook = xlApp.Workbooks.Open(chemin)
'pour ouvrir la feuille Feuil1 de mon fichier excel'
xlWorkSheet = xlWorkBook.Worksheets("Feuil1")
'pour ouvrir la feuille Feuil2 de mon fichier excel'
xlWorkSheetBis = xlWorkBook.Worksheets("Feuil2")
'compte les lignes de la feuille Feuil1 Excel'
numRows = 0
While Not (xlWorkSheet.Cells(numRows + 1, 1).value Is Nothing)
numRows = numRows + 1
End While
'compte les lignes de la feuille Feuil2 Excel'
numRowsBis = 0
While Not (xlWorkSheetBis.Cells(numRowsBis + 1, 1).value Is Nothing)
numRowsBis = numRowsBis + 1
End While |