baldmosher
New Member
- Joined
- Jul 10, 2009
- Messages
- 32
Lots of info about this but not much to help me that I could find.
In my case it's Access; the message pops up in Excel after a few seconds (and if I click OK, it pops back up after a few seconds) until Access has finished doing its thing, at which point clicking OK then just carries on with the macro.
It's not particularly annoying as Access carries on working in the background, but it does stop the rest of the Excel macro continuing so I can't believe there's not a very simple way to suppress it in VBA code, such as telling Excel to wait until the Access Application has finished its task before carrying on with the next line of code.
Is there an easy solution to this? Perhaps there isn't....
In my case it's Access; the message pops up in Excel after a few seconds (and if I click OK, it pops back up after a few seconds) until Access has finished doing its thing, at which point clicking OK then just carries on with the macro.
It's not particularly annoying as Access carries on working in the background, but it does stop the rest of the Excel macro continuing so I can't believe there's not a very simple way to suppress it in VBA code, such as telling Excel to wait until the Access Application has finished its task before carrying on with the next line of code.
Is there an easy solution to this? Perhaps there isn't....
Code:
Sub update_database()
Const dbn As String = "MyDatabase.mdb"
Const macn As String = "reload ALL"
Const objn As String = "Access.Application"
Dim pth As String
pth = ThisWorkbook.Path & "\"
Dim A As Object
Set A = CreateObject(objn)
A.Visible = False
A.OpenCurrentDatabase (pth & dbn)
[B]A.DoCmd.RunMacro macn
[/B]A.CloseCurrentDatabase
A.Quit
Set A = Nothing
End Sub