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