C
Chip
I have an Access 2003 application that I had to convert to Access 2007. I
use Application.FileSearch to go to a specified directory, report the number
of files found, import the files one by one and process them, then delete the
files from the directory so it is empty for the next set of files to be
added. My code is:
Dim fs, fn, fi 'stands for FileSearch, fn = filename, fi = file imported
Set fs = Application.FileSearch
With fs
.LookIn = "C:\Brinks\CurrentFiles"
.filename = "DEIBOLD*.CSV"
If .Execute > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
For I = 1 To .FoundFiles.Count
MsgBox .FoundFiles(I)
When I get to the line: Set fs = Application.FileSearch, I received a
runtime error 2455, you entered an expression that has an invalid reference
to the property FileSearch.
I can't get past this line of code. Research tells me I'm missing an object
library called Microsoft Office 2007 Access database engine Object Library.
I already have one called Microsoft Office 12.0 Access database engine Object
Library, but that doesn't find the "Application.FileSearch property.
Has anyone had this problem? Does anyone know how to resolve this issue?
I'm at my wit's end.
----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.
http://www.microsoft.com/office/com...aab61&dg=microsoft.public.access.externaldata
use Application.FileSearch to go to a specified directory, report the number
of files found, import the files one by one and process them, then delete the
files from the directory so it is empty for the next set of files to be
added. My code is:
Dim fs, fn, fi 'stands for FileSearch, fn = filename, fi = file imported
Set fs = Application.FileSearch
With fs
.LookIn = "C:\Brinks\CurrentFiles"
.filename = "DEIBOLD*.CSV"
If .Execute > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
For I = 1 To .FoundFiles.Count
MsgBox .FoundFiles(I)
When I get to the line: Set fs = Application.FileSearch, I received a
runtime error 2455, you entered an expression that has an invalid reference
to the property FileSearch.
I can't get past this line of code. Research tells me I'm missing an object
library called Microsoft Office 2007 Access database engine Object Library.
I already have one called Microsoft Office 12.0 Access database engine Object
Library, but that doesn't find the "Application.FileSearch property.
Has anyone had this problem? Does anyone know how to resolve this issue?
I'm at my wit's end.
----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.
http://www.microsoft.com/office/com...aab61&dg=microsoft.public.access.externaldata