Accessing VBA error 2486 DoCmd.Save
We are importing some code modules into Access 2002 application using the following line in VBA
Application.VBE.ActiveVBProject.VBComponents.Import (strFileName)
This part works fine, line right after trying to save the new class in the project. The only way we can do this is using DoCmd:
DoCmd.Save acModule, strModuleName
SOMETIMES this results in
Error 2486: You cannot perform this action at this time.
The longer version of the error gives the following:
You cannot perform this action at this time. You tried to run a macro or used a DoCmd object in Visual Basic to perform an action. However, Microsoft Access takes another action that prevents this action from being performed.
The fact that it says Access is performing another activity
it seems to make sense as we sometimes get an error. Is there a way to find out what is busy and wait for it to finish? Or is there a better way to implement import of modules?
I thought about writing something that would be until the module.Saved property is true, but this code is nasty enough without it ....
a source to share