Dim MyPath as String, MyName as String, FileCount as Integer
MyPath = "C:\GetPOB2S\B2SPO\B2S_PO_*.XML"
FileCount = 0
MyName = Dir(MyPath) ' Retrieve the first entry.
Do While MyName <> "" ' Start the loop.
FileCount = FileCount +1
MsgBox MyName
MyName = Dir ' Get next entry.
Loop
MsgBox "There were " & FileCount & " file(s) found."