FileSearch dislikes Zip-files

  • Thread starter Hub van de Laar
  • Start date
H

Hub van de Laar

L.S.

FileSearch doesn't report zip-files. Executing the Macro
you'll find below, does not list the zip-files that reside
in the specified directory. Replacing the FileName "*.zip"
by "*.*" lists all files except the zip-files.

I've reviewed the contents of the collections
PropertyTests and FileTypes, but could not get any results.

Using the interactive version at the Excel-sheet, via the
menu-options, I got the same results.

Kind regards,
Hub van de Laar



Private Sub ListZipFiles()
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 Zip-files found."
End If
End With
End Sub
 
D

Dave Peterson

Your code worked as-is for me (xl2002 and win98).

You may want to try:

..Filename = ".zip"
(drop the asterisk)

Although, there does seem to be problems with xl2002 not picking up all the
files. (but I've never seen it drop a complete extension, though.)
 
H

Harlan Grove

Dave Peterson said:
Your code worked as-is for me (xl2002 and win98).
....

It also worked for me using XL2K under WinME.

Anyone out there with the XL2003 beta want to test the macro under that?
 
H

Harlan Grove

Ron de Bruin said:
Hi Dave


Don't work for me Dave in Win Xp

But it did for me in XL2K under WinMe. This *could* be an OS difference,
since Win98 and WinMe are parent and child, but NT/2K/XP are distant
cousins. Which OS are you running Excel under?
 
H

Hub van de Laar

Ron,

I'm running under Win XP.

The option of omitting the "*", by only entering ".zip"
didn't work with me.

Kind regards,
Hub
 
R

Ron de Bruin

Only working in Win XP with Excel 2000
But in Win XP with Excel 2002 and 2003 not

Check out the link Dave posted with the Dir function
********************************
Myrna Larson recently posted some code by Bill Manville that uses DIR to search
through subfolders.

http://google.com/[email protected]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top