Wondering if the standard prompt you get when closing some xl workbooks (with formulae) has anything to do with it. You say the xl code runs fine, presumably when opened manually, so I'd guess that the lack of a delay in Access, which would allow xl to finish before Access attempts the next step, could be the problem. To be honest, I never bothered to master pauses with Do Events since it seems to be less than perfect. If bypassing the problem xl code only when Access is using the file is a possible work around, then you might be able to use a custom trigger in a shortcut command line switch to assign a value to the Command property of a db (I assume this is also possible with a workbook).
This value comes from the shortcut switch only if the shortcut is used to open the db. If it's there, you make code execution go one way, another if not.
Last edited by Micron; 05-24-2017 at 08:43 PM.
Reason: clarification
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.