Hi everybody!

I am trying to make a macro in excel to import automatically all the text
files within a folder to xls files.
So, I wrote a macro, in personal.xla
When Ilaunch the macro, I get a "error 400"...

Here is my macro :

Sub yann3()
'
' yann3 Macro
' Macro enregistrée le 12/04/05 par yann_vautrin
'

'
Dim cpt As Integer

' ouvre tous les fichiers contenus dans un dossier
chemin = InputBox("Entrez le chemin du dossier contenant les fichiers")
'on se met dans le repertoire
ChDir chemin
' on prend le premier fichier du repertoire
Fichier = Dir(chemin)
'parcours des fichiers
While Fichier <> ""

Workbooks.OpenText Fichier, Origin:=437, StartRow:=1, DataType:=xlDelimited,
TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True,
Semicolon:=False, _
Comma:=True, Space:=False, Other:=True, OtherChar:="-", FieldInfo:= _
Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5,
1), Array(6, 1), Array(7 _
, 1), Array(8, 1), Array(9, 1)), TrailingMinusNumbers:=True

ActiveWorkbook.SaveAs Filename:=Fichier, FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
ActiveWorkbook.Close


Wend
End Sub


Thanks for your help.

Yann