Open Access

  • Thread starter Thread starter Stuart
  • Start date Start date
S

Stuart

Hi

I need to determine if an access application is already
open from excel VBA.
I have no problems opening the file if it is already
closed but when i try to get the cureent access aplication
i get nothing.

Any help would be appreciated.
Thanks
 
Try the following:

Function isAccessOpen() As Boolean
On Error Resume Next
Dim oAccessApp As Object
Set oAccessApp = GetObject(, "Access.Application")
If Err.Number = 429 Then
isAccessOpen = False
ElseIf Err.Number <> 0 Then
MsgBox "Untrapped error: " & Err.Number & vbCrLf & Err.Description
isAccessOpen = False
Else
isAccessOpen = True
End If
Set oAccessApp = Nothing
End Function

/i.
 
Back
Top