I have a macro that renames a file at the end to change a .zip extension back to a .docx extension using the Name command:
Name strOldZip as strNewDocX
If I run this in debug mode, it works. However, whenever I run the macro full speed, it doesn’t work quite right. The .docx file gets created, but the .zip file icon remains on the desktop. The Word icon and filename don’t appear. So I have an empty icon of the .zip file on my desktop, and a .docx file that I’ve confirmed isn’t hidden, but doesn’t appear unless I search for it. (Once I find it in the search, I can drag it into a new folder and then back to get it to show up.)
I’ve tried making the macro sleep for a while after the name command, but that doesn’t work either. I think the hiccup might be in the time Windows needs to change the Desktop icons and display the new name, which is why it works in debug mode. Am I right? And if so, how do I get around this?
Posting as answer from @GSerg’s comment above:
“Try making it sleep before, not after.”
Worked like a charm. Thanks, GSerg!