createobject permission denied access vba

createobject permission denied access vba

Anonymous
Not applicable
580 Views
1 Reply
Message 1 of 2

createobject permission denied access vba

Anonymous
Not applicable
i don't think i've seen this problem in the discussion group before, so i'm hoping someone can help. i've had intermittent success trying to connect to autocad map 5 from access 97 and access 2000 vba running under windows 2000. the connection sometimes works, and other times fails at "CreateObject" with an error 70 ("permission denied"). autocad is installed on the same workstation where access is running. acadApp is declared in the calling procedure. i reference the autocad 2000 type library. i haven't been able to find a pattern to why it works sometimes and not othertimes. even when it fails, there is still an "acad.exe" process running. The code i'm using is similar to that found here in previous posts in this discussion group:

Public Sub ConnectToAcad(acadApp As AcadApplication)
On Error Resume Next
Set acadApp = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
Set acadApp = CreateObject("AutoCAD.Application")
If Err Then
Exit Sub
Else
Debug.Print "Starting new session " + acadApp.Name + _
" version " + acadApp.Version
End If
End If
Debug.Print "Now running " + acadApp.Name + _
" version " + acadApp.Version
End Sub

thanks for any help...
0 Likes
581 Views
1 Reply
Reply (1)
Message 2 of 2

DJ_ASM
Community Visitor
Community Visitor
This error is probably caused by the virus scanner blocking this action.

From the anti-virus log file :
2/3/2009 1:50:15 PM Blocked by Access Protection rule ......C:\WINDOWS\system32\svchost.exe C:\Program Files\Autodesk\Acade 2007\acad.exe.Config Anti-virus Maximum Protection:Prevent svchost executing non-Windows executables Action blocked : Execute

Solution is to add an exception for AutoCAD.
0 Likes