You are having network problems. By querying the macro and delaying, you are allowing time for the network to respond. You need to review your network design. I suspect it is kerberos problems related to timesync issues.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.