Hi Dan and Tyler, Apologies for not getting back to you sooner, it's been a hectic few weeks starting this new job and trying to work out how arcpy and everything works. I did try to make some example code to send you but this wasn't suffering the same problems and deleting the variables was cutting the connection with the files and freeing the memory as hoped. And now my code is working using this 'del' method and I couldn't work out what had changed to share with you. I can only think that you are right about it not working when Arcmap is open because it would have been open when I first suffered this problem and asked the question as I'd just installed it to get the code working in the first place, whereas I haven't opened it since and everything works now. But since Tyler is having the same problem I first had then there is perhaps more to it and something more complicated afoot. Obviously it isn't ideal to delete the variables and even arcpy itself, especially when arcpy is so finicky about whether this will actually work; so please let us know if you work out a better solution. Cheers for the help! Alex
... View more