Stepping through your code ...
What you search for with Dir:
and what you then create when you find that doesn't exist:
Spot the difference?
I'm guessing that you don't have Windows Explorer configured to show file extensions. If a file is shown with an Excel icon, it has been recognised as an Excel file and, for this to happen, it must have an Excel extension. So, just because a file name isn't listed with a file extension, it doesn't mean it isn't there.
When you are using Dir to check for the existence of the file, add: ' & ".xlsx"' (without the single quotes).
Regards, TMS
Bookmarks