ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open Access (https://www.excelbanter.com/excel-programming/282043-open-access.html)

Stuart[_7_]

Open Access
 
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

immanuel[_2_]

Open Access
 
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.

"Stuart" wrote in message
...
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





All times are GMT +1. The time now is 07:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com