Bonjour,
j'ai une erreur d'exécution dans mon Do while et je ne vois pas l'erreur si quelqu'un peut me la dire je le remercie d'avance.
voila mon code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 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
Partager