1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| Set AccessApp = CreateObject("Access.application")
With AccessApp.FileSearch
.NewSearch
.LookIn = xlPath
.SearchSubFolders = True
.Filename = xlFichier
.MatchTextExactly = False
.FileType = msoFileTypeExcelWorkbooks
.Execute
If .FoundFiles.Count > 0 Then
For i = 1 To .FoundFiles.Count
' nb de fichiers à traiter
xlFichierNb = .FoundFiles.Count
xlFichier = .FoundFiles.Item(i)
ProgressBarre.Max = xlFichierNb
ProgressBarre.Value = i
...
Set xlBook = xlApp.Workbooks.Open(xlFichier)
Set xlSheet = xlBook.Sheets("LaFeuilleEnQuestion")
For indCell = 1 To 12
For j = 0 To 30
... c'est ici que ca peut merder lors du parcours des cellules
... puis un insert
req = "INSERT into tbl_synthese (Nom,prenom,...) " _
& " VALUES ('" & sNom & "', '" & sPrenom & "', ..)"
db.Execute req
Next j
Next indCell
Next
End If
End With |
Partager