Link to home
Start Free TrialLog in
Avatar of Benita2003
Benita2003

asked on

Application.filesearch - Access Runtime problem

Hi,

In my application, I have the following codes:

Dim  strNotePadFile  as string, ii as interger

With Application.FileSearch
        .LookIn = "C:\"
        .SearchSubFolders = True
        .filename = "Notepad.exe"
       
    If .Execute() > 0 Then
        MsgBox "There were " & .FoundFiles.Count & _
            " file(s) found."
        ii = .FoundFiles.Count
        strNotePadFile = .FoundFiles(ii)           'return the path of the last one found
    Else
        MsgBox "There were no files found."
    End If

End With
       
It works fine in my development computer. However, when I install the application to another computer and runs the application with Access Runtime, the Application.filesearch.execute fails.

how do I fix this?

ASKER CERTIFIED SOLUTION
Avatar of wsteegmans
wsteegmans

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Benita2003
Benita2003

ASKER

All the references are there.
Actually, before posting this question, I thought about using Dir but did not try it, and I searched helpfile and find FileSystemObject but it has very little information there and I did not try it either. I wonder why Application.Filesearch is not working with Access Runtime.

I will give them a try and let you guys know.
Check that you have included all DLLs in the run-time library.

In order to check it - in the code window goto Tools->References and see what DLL's or OCX's are checked.

In the line below you will see the source of the file, for example "C:\WINNT\SYSTEM32\form20.dll" and copy the file to run time library.
----------------------------------------------------------------------------------------
This question has been abandoned and needs to be finalized.
 You can accept an answer, split the points, or get a refund (information at http:/help.jsp#hs5)
  If you need a moderator to help you, post a question at Community Support (http:/Community_Support/)

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

ornicar
Cleanup Volunteer

---------------------------------------------------------------------------------------------