Hi Steve,
As Ken says, closing an application like that can cause problems.
Maybe do something like this:
Dim accAccess As Object
On Error Resume Next
Set accAccess = GetObject(, "Access.Application")
If Err.Number = 0 Then
If accAccess.UserControl Then
'This instance of Access was launched by the user.
'Maybe we shouldn't close it.
...
Else
'This instance was launched by an automation process
'Maybe we can close it safely
accAccess.Quit
End If
Else
Err.Clear
End If
But in general I'd be inclined
(1) if possible to leave Access out of the picture. Most data
extraction and manipulation can be done by using the DAO or ADODB
libraries from Excel VBA without having to automate Access.
(2) when necessary, have the Excel code use CreateObject to open its
own instance of Access independent of anything else that might be
running.
See
http://support.microsoft.com/?id=210111 for more information on
automating Access.