Sauvegarde/export en fichier txt avec tabulation (Non visible)
Bonjour,
J'ai fait des recherches et j'ai trouvé des exemples et je suis arrivé a :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Sub SaveAs_Tab()
Filename = ActiveWorkbook.Name
If InStr(Filename, ".") > 0 Then
Filename = Left(Filename, InStr(Filename, ".") - 1)
End If
If Dir(Application.ActiveWorkbook.Path & "\" & Filename & ".txt") <> "" Then
Kill Application.ActiveWorkbook.Path & "\" & Filename & ".txt"
End If
PathSavetxt = Application.ActiveWorkbook.Path & "\" & Filename & ".txt"
Application.DisplayAlerts = False
Worksheets("Feuil1").Copy
With ActiveWorkbook
.SaveAS Filename:=PathSavetxt, FileFormat:=xlText, CreateBackup:=False
.Close False
End With
Application.DisplayAlerts = True
End Sub |
Quand je passe :
Worksheets("Feuil1").Copy
Cela ouvre une nouvelle fenêtre (vous allez me dire normal), mais j'aimerais qu'elle ne soit pas visible a l'écran, meme un bref instant, je trouve pas très agréable d'avoir des fenêtres qui s'ouvre et qui se ferme.
donc comment faire pour que "Worksheets("Feuil1").Copy" travaille en arrière plan ?
Avez une idée svp ?
En vous remerciant d'avance