tugsy
New Member
- Joined
- Aug 29, 2005
- Messages
- 26
I had a module for importing csv files into a Access database. I have since upgraded (or downgraded as it seems) to Office 2007.
Now when I run the macro I get this error:
Run-time error '2455':
You entered an expression that has an invalid reference to the property FileSearch.
Here is my module:
Any help would be appreciatated.
Thanks,
Tugsy
Now when I run the macro I get this error:
Run-time error '2455':
You entered an expression that has an invalid reference to the property FileSearch.
Here is my module:
Code:
Sub ImportWorkbooks()
Dim FilesToProcess As Integer
Dim i As Integer
Dim ThisEntry
Const TOP_FOLDER = "D:\calls2008" 'adjust folder name to suit
With Application.FileSearch
.NewSearch
.LookIn = TOP_FOLDER
.SearchSubFolders = True
.Filename = "*.csv"
.Execute
FilesToProcess = .foundfiles.Count
For i = 1 To FilesToProcess
'import each file
DoCmd.TransferText acImportDelim, "phone_import_specs", "PhoneData", .foundfiles(i), True
Next i
End With
End Sub
Any help would be appreciatated.
Thanks,
Tugsy