Hi Everyone,
I hope someone can shed a little light on this for me.
I use the following code to check if there are any text files to be imported when I open my DB. It works fine in a full Version but doesn't work in the Run time Version. By inserting message boxes all over I have found that it probably bombs out on the line " if .execute(sortBy:=.......) It produces no error message . just doesn't import the file - obviously this line returns a 0 Value - but why?
Set fs = Application.FileSearch
With fs
.LookIn = "C:\My Files"
.FileName = "*.exp"
If .Execute(SortBy:=msoSortByLastmodified, SortOrder:=msoSortOrderDescending) >0 then ... (this does not happen in a Run Time Version)
for i=1 to .Foundfiles.count
thefile=.foundFiles(i)
latestdate=FileDateTime(thefile)
if latestDate > lastdate then
......
.......
end if
...
....
End With
I really would appreciate a little help.
Thanks
Marion
Germany
I hope someone can shed a little light on this for me.
I use the following code to check if there are any text files to be imported when I open my DB. It works fine in a full Version but doesn't work in the Run time Version. By inserting message boxes all over I have found that it probably bombs out on the line " if .execute(sortBy:=.......) It produces no error message . just doesn't import the file - obviously this line returns a 0 Value - but why?
Set fs = Application.FileSearch
With fs
.LookIn = "C:\My Files"
.FileName = "*.exp"
If .Execute(SortBy:=msoSortByLastmodified, SortOrder:=msoSortOrderDescending) >0 then ... (this does not happen in a Run Time Version)
for i=1 to .Foundfiles.count
thefile=.foundFiles(i)
latestdate=FileDateTime(thefile)
if latestDate > lastdate then
......
.......
end if
...
....
End With
I really would appreciate a little help.
Thanks
Marion
Germany
Last edited: