Comme tout se déroule bien jusqu'à la dernière procédure impression, le problème viendrait il de la? C'est une procédure que j'ai adapté d'un tutoriel et que je ne comprends pas entièrement...
Sub Impression() 'bouton SEND (pour envoyer une commande dans le fichier texte "COMMANDES")
Dim TheText As String
Dim TheFile As Variant
Dim FCMC_text As String
If FCMC = 1 Then
FCMC_text = "FCQRH"
Else: FCMC_text = "MSO-ARO-QRH"
End If
If MsgBox("Please close the dedicated XML to be recorded correctly.", vbYesNo + vbQuestion + vbDefaultButton2, "Confirmation de Sauvegarde") = vbYes Then
TheFile = ThisWorkbook.Path & "\COMMANDES_" & WarCau & "_" & FCMC_text & ".xml"
If TheFile = False Then Exit Sub
On Error GoTo Out 'si le fichier est ouvert
Open TheFile For Output As #1
TheText = Table
Print #1, TheText
MsgBox "Recorded with success."
Close
Exit Sub
Out:
MsgBox "The files seems already opened, updated is impossible", vbCritical, "Back up impossible"
Close
End If
End Sub