Initializing a string variable can be tricky sometimes. Instead of defining safefilename in the initialization process, try this and let me know if it works out for you.


Dim safefilename As...