Hi
Ive just got this code which is supposed to open autocad but I cant get it to work here are relevant? details
drawing file "C:AutoCAD Biblemodel.dwg"
App file "C:Progeam FilesAutoCAD 2002acad.exe"
and here is Code:
Public Sub StartCad(Optional AcVisiblity As Boolean = True)
Dim oAcadApp As AcadApplication 'The AutoCAD application object
Dim i As Integer: i = 0
On Error Resume Next
Set oAcadApp = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
Restart:
Set oAcadApp = CreateObject("AutoCAD.Application")
oAcadApp.Visible = True
If Err.Number = 91 Then
Err.Clear
If i = 3 Then
Exit Sub
Else
GoTo Restart
i = i + 1
End If
Else
Err.Clear
Exit Sub
End If
End If
oAcadApp.Visible = AcVisiblity
'Use oAcadApp object here
End Sub
thanks
Sue
Ive just got this code which is supposed to open autocad but I cant get it to work here are relevant? details
drawing file "C:AutoCAD Biblemodel.dwg"
App file "C:Progeam FilesAutoCAD 2002acad.exe"
and here is Code:
Public Sub StartCad(Optional AcVisiblity As Boolean = True)
Dim oAcadApp As AcadApplication 'The AutoCAD application object
Dim i As Integer: i = 0
On Error Resume Next
Set oAcadApp = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
Restart:
Set oAcadApp = CreateObject("AutoCAD.Application")
oAcadApp.Visible = True
If Err.Number = 91 Then
Err.Clear
If i = 3 Then
Exit Sub
Else
GoTo Restart
i = i + 1
End If
Else
Err.Clear
Exit Sub
End If
End If
oAcadApp.Visible = AcVisiblity
'Use oAcadApp object here
End Sub
thanks
Sue