Why you need to traverse through the complete folder when you can simply use FileExists Method
For required codes, check the macro from this post Macro to save as a PDF with a different name every time
Thanks Deepak. I am new to VBA so I didn't know about the FileExists method. I will read over the linked thread and post my code here later.
It seems like the code works as intended. Here is the excerpt, where myPath is the string that contains the path of the file to be saved. If that path already exists, the macro is ended and the user is notified of the conflict.
Dim myPath As String
Dim FSO As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
If FSO.FileExists(myPath) Then
MsgBox ("There is already a file in that location.")