Message 1 of 2
createobject permission denied access vba

Not applicable
08-28-2002
07:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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...
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...