pb lors de l'importation multiple de fichiers txt
Bonjour,
Sauriez vous d'où viens le problème dans le code suivant lorsque j'essaie d'importer plusieurs fichiers txt? Merci par avance
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Sub MassImport()
Dim strPath As String
Dim strFileName As String
Dim dbf As Database
Set dbf = CurrentDb
' Set the path to the directory where the files will be.
strPath = "H:\01 EDB\05 DIVERS\exoACCESS\import\"
strFileName = Dir(strPath & ".txt") ' Retrieve the first entry.
Do While strFileName <> "txt" ' Start the loop.
DoCmd.TransferText acImportDelim, ncep, strPath & strFileName
strFileName = Dir ' Get next entry.
Loop
MsgBox "Objects imported successfully!", vbInformation, "Import Status"
End Sub |