Re : Problème de sauvegarde avec SaveAs
Bon je pense avoir trouvé, je me suis inspiré de ce que j'ai pu trouver sur ce forum.
Pour ceux que ca intéresse :
je vous laisse mon code....ca fonctionne sur Excel 2003 mais j'ai pas testé sous Excel 2007
Sub Exporter()
Dim nomfichier As String
Application.DisplayAlerts = False
repertoire = Sheets("Paramètres").Range("Repertoire")
Sheets("TA1").Select
Sheets("TA1").Copy
ChDir repertoire
nomfichier = repertoire & "\" & "TA1.txt"
If FileExists(nomfichier) Then
Application.Dialogs(xlDialogSaveAs).Show arg1:=nomfichier, arg2:=xlTextMSDOS
Else
ActiveWorkbook.SaveAs Filename:=nomfichier
End If
ActiveWorkbook.SaveAs Filename:=nomfichier, FileFormat:=xlTextMSDOS, CreateBackup:=False
ActiveWindow.Close False
Application.DisplayAlerts = True
End Sub
Function FileExists(sFilePath As String) As Boolean
FileExists = (Dir(sFilePath) <> "")
End Function