ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Findfiles finds(?) phantom files.... (https://www.excelbanter.com/excel-programming/317183-findfiles-finds-phantom-files.html)

Simon

Findfiles finds(?) phantom files....
 
I have a handful of macros that I have bundled into an addin for
distribution to my colleagues. Despite all efforts to be clear on
how/where to install it, some users continue to have trouble. The result
of this is that when I send an update, some people are having trouble as
they have copies in multiple locations....

In an effort to overcome this I have a wrote another macro that
uninstalls the addin, then finds and deletes the source file(s).

This works fine except that the .findfile part appears to be finding files
on the H: drive (a network drive) that don't (as far as I can tell) exist
(actually, the really perplexing part is that it appears to find multiple
instances of the SAME file in the SAME directory, eg test.xla and
Test.xla...)

code is as follows (the KILL statement has been replaced with the
messagebox so I could see what was returned) -

With Application.FileSearch
.NewSearch
.LookIn = "h:\"
.SearchSubFolders = True
.Filename = "test*.xla"
.MatchTextExactly = True
If .Execute 0 Then
For i = 1 To .FoundFiles.count
' Kill .FoundFiles(i)
StrMsg = StrMsg & .FoundFiles(i) & vbCrLf
Next i
End If
MsgBox StrMsg
End With

I've asked around and noone I know has ever seen anything like this and I'd
really like to solve it (I'm keen to get rid of all those old versions...)
so all suggestions gratefully received

TIA

S

--
Instead of building bigger and better weapons of mass destruction,
we should be trying to get better use out of the ones we've already got....


All times are GMT +1. The time now is 11:47 AM.

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