darkspoilt
Expert
Bonjour,
j'ai une erreur dans ma boucle cette fonction a été créer pour trouver la ligne d'une donnée dans un tableau excel et il me met une erreur dans mon Do while
Est ce bonne syntaxe?
Je remercie d'avance ceux ki verront l'erreur
[cpp]
Public Function Ligne() As Long
Dim AppExcel As Excel.Application
Dim wbFile As Excel.Workbook
Dim i As Long
Set AppExcel = CreateObject("Excel.Application") ' Ouverture d'excel
If Not AppExcel Is Nothing Then
Set wbFile = AppExcel.Workbooks.Open("Test\Essai.xls", False, True) 'Ouverture du classeur
If Not wbFile Is Nothing Then
i = 1
Do While Cells(i, 1).Text <> "TOTAL"
i = i + 1
Loop
wbFile.Close
AppExcel.Application.Quit
Set AppExcel = Nothing
End If
End If
Ligne = i
End Function
[/cpp]
j'ai une erreur dans ma boucle cette fonction a été créer pour trouver la ligne d'une donnée dans un tableau excel et il me met une erreur dans mon Do while
Est ce bonne syntaxe?
Je remercie d'avance ceux ki verront l'erreur
[cpp]
Public Function Ligne() As Long
Dim AppExcel As Excel.Application
Dim wbFile As Excel.Workbook
Dim i As Long
Set AppExcel = CreateObject("Excel.Application") ' Ouverture d'excel
If Not AppExcel Is Nothing Then
Set wbFile = AppExcel.Workbooks.Open("Test\Essai.xls", False, True) 'Ouverture du classeur
If Not wbFile Is Nothing Then
i = 1
Do While Cells(i, 1).Text <> "TOTAL"
i = i + 1
Loop
wbFile.Close
AppExcel.Application.Quit
Set AppExcel = Nothing
End If
End If
Ligne = i
End Function
[/cpp]