If someone or something has the file open when your code runs, it will give such an error message. Bouncing the server seems to clear it because the file is on the server and bouncing it forces a disconnect.
--Jeff Moden
Change is inevitable... Change for the better is not.