keeyean
Civil/Environmental
- Sep 11, 2001
- 14
below is the sub to open AutoCAD program... but how do i change it to.. when i had open a AutoCAD file... then.. it will on automatically open another blank AutoCAD new file??
Public Sub OpenAutoCAD()
Dim DwgName As String
On Error Resume Next
Set acadApp = GetObject(, "AutoCAD.Application"
If Err Then
Set acadApp = CreateObject("AutoCAD.Application"
Err.Clear
End If
If Right(App.Path, 1) = "\" Then
DwgName = App.Path & "facility.dwg"
Else
DwgName = App.Path & "\facility.dwg"
End If
Set acadDoc = acadApp.activedocument
If acadDoc.fullname <> DwgName Then
acadDoc.Open DwgName
End If
acadApp.Visible = True
End Sub
Public Sub OpenAutoCAD()
Dim DwgName As String
On Error Resume Next
Set acadApp = GetObject(, "AutoCAD.Application"
If Err Then
Set acadApp = CreateObject("AutoCAD.Application"
Err.Clear
End If
If Right(App.Path, 1) = "\" Then
DwgName = App.Path & "facility.dwg"
Else
DwgName = App.Path & "\facility.dwg"
End If
Set acadDoc = acadApp.activedocument
If acadDoc.fullname <> DwgName Then
acadDoc.Open DwgName
End If
acadApp.Visible = True
End Sub