filedetection ==> phantomfiles

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
Dear Excellers,
running this code, Excel finds files that were deleted previously, and doesn't find files added recently - even after restarting computer
Excel finds phantoms !? Excel's filedetection doesn't work good ?!

probably the experts will find a mistake in this code
Code:
Sub find_files()
With Application.FileSearch
    .NewSearch
    .LookIn = ThisWorkbook.Path & "\"
    .SearchSubFolders = True
    .Filename = "*.xls"
    .FileType = msoFileTypeOfficeFiles
    
    If .Execute() > 0 Then
        For I = 1 To .FoundFiles.Count
          If MsgBox("Do you want to delete this file ?" & Chr(10) & .FoundFiles(I), 36, "DELETE FILE") = vbYes Then
          Kill .FoundFiles(I)
          End If
        Next I
    End If
End With
End Sub
Or don't you have this phantom problems?

kind regards,
Erik
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
I have not seen that, but just for the heck of it, run the code the way you have it by listing all the files in column A, then drag that list into some other column. Re-run the macro but change
SearchSubFolders = True
to
SearchSubFolders = False
and see if that changes anything.


One of the most misunderstood and misrepresented facets in the world of computers is the concept of "delete". Whether you delete the contents of an Excel cell, or a Word paragraph, or a file from the hard drive, or even employ a commercially sold "wipe" program to wipe your hard drive, the information never really leaves your hard drive after it's been put on.

Computer forensics can recover data that the user thought was deleted or wiped because hard drives never actually release the data that was put on them. The most that ever happens is data is covered with encrypted code (often binary zeros and ones), but the underlying original data is still there. Products like GoBack simply fool the hard drive into thinking the date and time is earlier than it really is, and the underlying data is uncovered, hence recovered as far as the user is concerned.

This might have absolutely nothing to do with the problem you are seeing. We have to start somewhere with your question though, and maybe (as far as your computer is concerned) your code to search all subfolders includes deleted or behind-the-scenes temporary folders where a document was first downloaded.
 
Upvote 0
Tom,

thanks a lot for the intresting explanations
I tryed to do what you said ...
now nothing is found anymore !
no way to display whatsoever ?
I'm sure for 1000% that the file is in a map with other files
I tried also C:\ an D:\ (my two disks) with and without subfolders
I tried with a button in a program that's used by hunderds of people. (I let them push a button with this code to help them from distance, so I'm sure the code works normally)

more phantoms ?
Erik
 
Upvote 0

Forum statistics

Threads
1,215,454
Messages
6,124,933
Members
449,195
Latest member
Stevenciu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top