View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Strange problem with filesearch...help

Set objFileSearch = Application.FileSearch
With objFileSearch
.NewSearch
.LookIn = startSearchDirectory
.SearchSubFolders = True
.filename = holdThisFileName
'MatchTextExactly = True
If .Execute 0 Then
for i = 1 to .foundfiles.count
if Ucase(holdThisFileName) = Ucase(.filename(i)) then

MsgBox "There is already a file named " & holdThisFileName &
", in the system. If you are unsure how to proceed then please speak
to your supervisor.", vbOKOnly, "File Conflict..."
Application.ScreenUpdating = True
Application.DisplayAlerts = True
Exit Sub
end if
Next
End If
End With

--
Regards,
Tom Ogilvy


reesmacleod wrote in message
...

The line

holdName = .filename

is not supposed to be there...was some wrong code

Thx


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to

creating financial statements