I'm attempting to use a 97 access database in access 2002 (access XP).
When I run the code below (which works fine in 97) the With Application.Filesearch text is highlighted in yellow and accompanied by the following error
"Run Time Error -2147467259 (80004005)
Method 'Filesearch' of object'_Application' failed"
Public Function Importfiles()
Dim strPath As String
With Application.FileSearch
.NewSearch
.fileName = "*.xls"
.SearchSubFolders = True
.LastModified = msoLastModifiedAnyTime
.LookIn = "s:\shared\returns"
.Execute
strPath = .FoundFiles(1)
End With
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, "Table Name Here", strPath
End Function
I've inherited this database and I'm not that familiar with access.
Any ideas as to why this happens?
All help greatfully received.
When I run the code below (which works fine in 97) the With Application.Filesearch text is highlighted in yellow and accompanied by the following error
"Run Time Error -2147467259 (80004005)
Method 'Filesearch' of object'_Application' failed"
Public Function Importfiles()
Dim strPath As String
With Application.FileSearch
.NewSearch
.fileName = "*.xls"
.SearchSubFolders = True
.LastModified = msoLastModifiedAnyTime
.LookIn = "s:\shared\returns"
.Execute
strPath = .FoundFiles(1)
End With
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, "Table Name Here", strPath
End Function
I've inherited this database and I'm not that familiar with access.
Any ideas as to why this happens?
All help greatfully received.