jonathann3891
Board Regular
- Joined
- Apr 27, 2015
- Messages
- 109
I have a macro that will lauch AutoCAD and open a specified drawing.
Is there a way to check if AutoCAD is running, and if so DO NOT open another drawing??
Is there a way to check if AutoCAD is running, and if so DO NOT open another drawing??
Code:
Public Sub OpnAcad()
Dim strDrawing As String
On Error Resume Next
Set Graphics = GetObject(, "AutoCAD.Application")
If Err.Description > vbNullString Then
Err.Clear
Set Graphics = CreateObject("AutoCAD.Application")
End If
' ACAD.Visible = True
strDrawing = "C:\Users\username\Desktop\test\PileSchedule.dwg"
Graphics.Documents.Open (strDrawing)
On Error GoTo 0
End Sub