Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default FileSearch dislikes Zip-files

L.S.

I encountered some problems using the FileSearch object.
Using the Macro you'll find below, it doesn'list the zip-
files that reside in the specified directory. When
replacing the Filename "*.zip" by "*.*", it lists all
files except the zip-files.

I've already reviewed the contents of the collections
PropertyTests and FileTypes, but had no results.

Using the interactive FileSearch from the Excel-sheet via
the menu-option provides the same results.


Private Sub CheckAllZipFiles()
Dim FS As FileSearch, I As Integer
With Application.FileSearch
.NewSearch
.LookIn = "D:\"
.FileType = msoFileTypeAllFiles
.Filename = "*.zip"
.SearchSubFolders = True
If .Execute 0 Then
For I = 1 To .FoundFiles.Count
Debug.Print .FoundFiles(I)
Next I
Else
MsgBox "No files found."
End If
End With
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default FileSearch dislikes Zip-files

Please stay in your other thread Hub
See a possible solution in there


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



"Hub van de Laar" wrote in message ...
L.S.

I encountered some problems using the FileSearch object.
Using the Macro you'll find below, it doesn'list the zip-
files that reside in the specified directory. When
replacing the Filename "*.zip" by "*.*", it lists all
files except the zip-files.

I've already reviewed the contents of the collections
PropertyTests and FileTypes, but had no results.

Using the interactive FileSearch from the Excel-sheet via
the menu-option provides the same results.


Private Sub CheckAllZipFiles()
Dim FS As FileSearch, I As Integer
With Application.FileSearch
.NewSearch
.LookIn = "D:\"
.FileType = msoFileTypeAllFiles
.Filename = "*.zip"
.SearchSubFolders = True
If .Execute 0 Then
For I = 1 To .FoundFiles.Count
Debug.Print .FoundFiles(I)
Next I
Else
MsgBox "No files found."
End If
End With
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default FileSearch dislikes Zip-files

Change
.filename = "*.zip"
to
.filename = ".zip"

--
Regards,
Tom Ogilvy

Hub van de Laar wrote in message
...
L.S.

I encountered some problems using the FileSearch object.
Using the Macro you'll find below, it doesn'list the zip-
files that reside in the specified directory. When
replacing the Filename "*.zip" by "*.*", it lists all
files except the zip-files.

I've already reviewed the contents of the collections
PropertyTests and FileTypes, but had no results.

Using the interactive FileSearch from the Excel-sheet via
the menu-option provides the same results.


Private Sub CheckAllZipFiles()
Dim FS As FileSearch, I As Integer
With Application.FileSearch
.NewSearch
.LookIn = "D:\"
.FileType = msoFileTypeAllFiles
.Filename = "*.zip"
.SearchSubFolders = True
If .Execute 0 Then
For I = 1 To .FoundFiles.Count
Debug.Print .FoundFiles(I)
Next I
Else
MsgBox "No files found."
End If
End With
End Sub



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default FileSearch dislikes Zip-files

That may be an operating system thing. I believe in Windows XP, you can
look at the interior of a zip file like it was a folder - so that might be
what filesearch is doing.

However, in Excel 2000 on Windows XP professional, It worked for me - found
the zip files. BUt on some, I was getting a double find - found it twice.

I guess the robust solution would be to have it pull a list of all files,
then run through the list and extract the zip files, or use the filesystem
object or the windows API.

--
Regards,
Tom Ogilvy



Ron de Bruin wrote in message
...
I tested it in Win XP Office 2002 and 2003
And it don't see Zip files Tom

With and without the *

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



"Tom Ogilvy" wrote in message

...
Change
.filename = "*.zip"
to
.filename = ".zip"

--
Regards,
Tom Ogilvy

Hub van de Laar wrote in message
...
L.S.

I encountered some problems using the FileSearch object.
Using the Macro you'll find below, it doesn'list the zip-
files that reside in the specified directory. When
replacing the Filename "*.zip" by "*.*", it lists all
files except the zip-files.

I've already reviewed the contents of the collections
PropertyTests and FileTypes, but had no results.

Using the interactive FileSearch from the Excel-sheet via
the menu-option provides the same results.


Private Sub CheckAllZipFiles()
Dim FS As FileSearch, I As Integer
With Application.FileSearch
.NewSearch
.LookIn = "D:\"
.FileType = msoFileTypeAllFiles
.Filename = "*.zip"
.SearchSubFolders = True
If .Execute 0 Then
For I = 1 To .FoundFiles.Count
Debug.Print .FoundFiles(I)
Next I
Else
MsgBox "No files found."
End If
End With
End Sub







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default FileSearch dislikes Zip-files

Hi Tom

Win XP Pro with Excel 2000
Code is working correct for me with a small test

So it seems a Office 2002/2003 problem Tom under Win XP

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



"Ron de Bruin" wrote in message ...
Hi Tom

I guess the robust solution would be to have it pull a list of all files,
then run through the list and extract the zip files, or use the filesystem
object or the windows API


I think you are right about that

I will test it also on Win XP with Excel 2000 and post
back with the result



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



"Tom Ogilvy" wrote in message ...
That may be an operating system thing. I believe in Windows XP, you can
look at the interior of a zip file like it was a folder - so that might be
what filesearch is doing.

However, in Excel 2000 on Windows XP professional, It worked for me - found
the zip files. BUt on some, I was getting a double find - found it twice.

I guess the robust solution would be to have it pull a list of all files,
then run through the list and extract the zip files, or use the filesystem
object or the windows API.

--
Regards,
Tom Ogilvy



Ron de Bruin wrote in message
...
I tested it in Win XP Office 2002 and 2003
And it don't see Zip files Tom

With and without the *

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



"Tom Ogilvy" wrote in message

...
Change
.filename = "*.zip"
to
.filename = ".zip"

--
Regards,
Tom Ogilvy

Hub van de Laar wrote in message
...
L.S.

I encountered some problems using the FileSearch object.
Using the Macro you'll find below, it doesn'list the zip-
files that reside in the specified directory. When
replacing the Filename "*.zip" by "*.*", it lists all
files except the zip-files.

I've already reviewed the contents of the collections
PropertyTests and FileTypes, but had no results.

Using the interactive FileSearch from the Excel-sheet via
the menu-option provides the same results.


Private Sub CheckAllZipFiles()
Dim FS As FileSearch, I As Integer
With Application.FileSearch
.NewSearch
.LookIn = "D:\"
.FileType = msoFileTypeAllFiles
.Filename = "*.zip"
.SearchSubFolders = True
If .Execute 0 Then
For I = 1 To .FoundFiles.Count
Debug.Print .FoundFiles(I)
Next I
Else
MsgBox "No files found."
End If
End With
End Sub











Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application.FileSearch Cleberton(Brazilian) Excel Discussion (Misc queries) 2 October 26th 09 01:21 PM
FileSearch in a combo box michaelberrier Excel Discussion (Misc queries) 0 June 16th 06 12:21 AM
FileSearch doesn't find zip files Hub van de Laar Excel Programming 3 September 1st 03 07:43 PM
FileSearch Code Pedro[_4_] Excel Programming 1 August 6th 03 02:27 PM
FileSearch Problem Bin[_2_] Excel Programming 6 August 2nd 03 02:04 PM


All times are GMT +1. The time now is 09:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"