Sub modifXMLLigneEtape2()
Dim CurrentPath As String
CurrentPath = Application.ThisWorkbook.Path & "\"
Dim CalculationTime As Single
CalculationTime = Timer
Dim TempLigne As String
Dim TempLigneSelectionAGargerDebut As String
Dim TempLigneSelectionAGargerFin As String
Open CurrentPath & "Inté.xml" For Input As #1
Open CurrentPath & "RESULTAT_FINAL.xml" For Output Access Write As #2
Do While Not EOF(1)
Line Input #1, TempLigne
If TempLigne Like "*<baliseouvrante>*</baliseouvrante>*" Then
TempLigneSelectionAGargerDebut = InStr(1, TempLigne, "<baliseouvrante>") - 1
TempLigneSelectionAGargerFin = InStr(1, TempLigne, "</baliseouvrante>") + 16
TempLigne = Left(TempLigne, TempLigneSelectionAGargerDebut) & Right(TempLigne, Len(TempLigne) - TempLigneSelectionAGargerFin)
Debug.Print TempLigne
Print #2, TempLigne
Else
Print #2, TempLigne
Debug.Print TempLigne
End If
Loop
Close #1
Close #2
Debug.Print Timer - CalculationTime
'ActiveWorkbook.XmlImport URL:=Currenpath & "RESULTAT_FINAL.xml", _
'ImportMap:=Nothing, Overwrite:=True, Destination:=Range("$B$2")
End Sub