I have a recurring issue when saving an Excel addin I have created. Basically when I try to save (either via the 'Save' button in the VBA editor or via 'thisworkbook.save') the file tries, retries over and over again to save and fails - reporting that there are errors.
During the attempts a 0 byte temporary file is created but this is removed once Excel has finally given up. It usually takes about 10 mins to give up.
What is even more confusing is that the error occurs randomly. Sometimes it can save sucessfully 8 times before an error and sometimes it happens every time - and every variation in between.
I only ever make small code changes (like 20 / 50 lines) between saves. So I can't imagine it is the changes and if so why the random success afterwards, surely after I have added a block of code which is causing an issue - the save should fail from then on, but it doesn't allways.
I only have one instance active at a time usually. There does not appear to be any correlation between the fails and multiple sessions.
I have tried the following:
Rebuilding the addin from scratch but creating a new Excel file and reimporting all forms and modules
Using a sub to save the addin by using 'thisworkbook.save'
Modifying my save sub to disable DDE interchange for the duration of the save (via 'Application.IgnoreRemoteRequests'). This was based on a web article I found about another user who had issue saving and XL 2010 XLAM
Restarting the machine after an error - before another attempt
Checking disks access to see if the virus checker is trying to scan the file and has therefore locked it
Made certain I have enough disk space and there are no quotas or anything that could be blocking the save.
Unfortunately (annoying & limiting I know) but I cannot upload the actual file as it is for a client and contains proprietary code and information.
Can anyone suggest what could be the cause because it is driving me mad and slowing development ?