J'ai toujours le même probleme.
Le message d'erreur est Impossible de lire la propriété findnext de la fonction range
Runtime error 1004.
Pourquoi j'ai ce problème ?
Voici le code:
Sub Main()
'Dim sht As Worksheets
Set app_exc = CreateObject("Excel.application") 'demande a communiquer avec excel.
app_exc.DisplayAlerts = False ' affiche les messages d'alertes ou pas.
app_exc.Visible = True ' affiche ou cache excel
app_exc.Application.WorkBooks.Open ("C:\temp\seb.xls") 'ouvre le fichier
For feuille = 1 To app_exc.Sheets.Count
app_exc.Sheets(feuille).Activate
Set trouvé1 = app_exc.Cells.Find(What:="seb")
If Not trouvé1 Is Nothing Then
trouvé1.Activate
dr = trouvé1.Address
app_exc.Application.Range(dr).Value = "seb1"
End If
essai:
' BUG ICI **************
Set trouvé2 = app_exc.Cells.FindNext(After:=ActiveCell)
If Not trouvé2 Is Nothing Then
trouvé2.Activate
dr = trouvé2.Address
app_exc.Application.Range(dr).Value = "seb1"
End If
GoTo essai
Next feuille
app_exc.Application.ActiveWorkbook.Close True ' Sauvegarde le fichier
app_exc.Application.Quit
Set app_exc = Nothing
End Sub
Merci
Sebastien
