I'm with smUX.
Besides this when you want to check whether a file name is in particular format or not then use the LIKE keyword.
VB Code:
m = Dir("C:\Test\*.*") If Not UCase(m) Like "A##.DOC" Then 'filters out files like A001.doc, A56.doc etc. 'invalid file name. etc. MsgBox "Invalid file name" & m Else 'whatever End If
Pradeep![]()




icon on the left of the post.
Reply With Quote