Let's make it clear: Forget your code, it's disfunctional and fragile. I am surprised it works on your computer, many key-ins don't work on mine. And even when I simplified the code so I use only official key-ins that work, I ended also with saveall key-in problem. This key-in is not published in key-in dialog and evidently it does not work fine (sometimes it seems it works, sometimes it doesn't). There is no solution for unpublished key-ins bugs.
Regards,
Jan
Regards,
Jan