ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Filename search using Office 97 with Windows 2000 (https://www.excelbanter.com/excel-programming/277051-filename-search-using-office-97-windows-2000-a.html)

Dave[_30_]

Filename search using Office 97 with Windows 2000
 
Sorry, got a little happy with the enter key.

I can't get this to work with the mentioned combination. I
have it working fine on a Windows 2000 machine running
Office 2000, and on a Windows 95 machine running Office
97, but when I try to run it on a Windows 2000 machine
with Office 97, I get a application error. The code stops
running at the .Filename = "*.txt" line of code.

Thanks in advance for any help.
Dave

-----Original Message-----
Hi,
Set fs = Application.FileSearch

With fs
.LookIn = "C:\My Documents"
.Filename = "*.txt"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
.


Ron de Bruin

Filename search using Office 97 with Windows 2000
 
Hi Dave

Try .Text instead of *.Text

Post back if this not work for you

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Dave" wrote in message ...
Sorry, got a little happy with the enter key.

I can't get this to work with the mentioned combination. I
have it working fine on a Windows 2000 machine running
Office 2000, and on a Windows 95 machine running Office
97, but when I try to run it on a Windows 2000 machine
with Office 97, I get a application error. The code stops
running at the .Filename = "*.txt" line of code.

Thanks in advance for any help.
Dave

-----Original Message-----
Hi,
Set fs = Application.FileSearch

With fs
.LookIn = "C:\My Documents"
.Filename = "*.txt"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
.




Dave[_30_]

Filename search using Office 97 with Windows 2000
 
Ron,
That worked. Thanks alot. Why does this combination
not like the wild card?

Dave

-----Original Message-----
Hi Dave

Try .Text instead of *.Text

Post back if this not work for you

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Dave" wrote in message

...
Sorry, got a little happy with the enter key.

I can't get this to work with the mentioned

combination. I
have it working fine on a Windows 2000 machine running
Office 2000, and on a Windows 95 machine running Office
97, but when I try to run it on a Windows 2000 machine
with Office 97, I get a application error. The code

stops
running at the .Filename = "*.txt" line of code.

Thanks in advance for any help.
Dave

-----Original Message-----
Hi,
Set fs = Application.FileSearch

With fs
.LookIn = "C:\My Documents"
.Filename = "*.txt"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
.



.


Ron de Bruin

Filename search using Office 97 with Windows 2000
 
Hi Dave

I can tell you why it work this way
I have read that this is sometimes a solution.


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Dave" wrote in message ...
Ron,
That worked. Thanks alot. Why does this combination
not like the wild card?

Dave

-----Original Message-----
Hi Dave

Try .Text instead of *.Text

Post back if this not work for you

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Dave" wrote in message

...
Sorry, got a little happy with the enter key.

I can't get this to work with the mentioned

combination. I
have it working fine on a Windows 2000 machine running
Office 2000, and on a Windows 95 machine running Office
97, but when I try to run it on a Windows 2000 machine
with Office 97, I get a application error. The code

stops
running at the .Filename = "*.txt" line of code.

Thanks in advance for any help.
Dave

-----Original Message-----
Hi,
Set fs = Application.FileSearch

With fs
.LookIn = "C:\My Documents"
.Filename = "*.txt"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
.



.





All times are GMT +1. The time now is 01:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com