Professional Documents
Culture Documents
Book 1
Book 1
Sub Drawing_Creator()
Dim acadApp As AcadApplication
Dim acadDoc As AcadDocument
Dim phApp As PhantomPDF.Application
Dim phDoc As PhantomPDF.Document
Dim wb As Workbook
Dim ws1 As Worksheet, ws2 As Worksheet
Dim Bname As String, Name As String, Tname As String, Tpath As String, EWClength As String, _
Fpath As String, OldFile As String, NewFile As String, Cname As String
Dim bValidDoc As Boolean
Set wb = ThisWorkbook
Set ws1 = wb.Worksheets("EWC Info")
Set ws2 = wb.Worksheets("Shapes Database")
Cname = ws1.Range("C11")
Tname = Excel.WorksheetFunction.VLookup(Cname, ws2.Range("C2:G2092"), 4, False)
'Opening AutoCAD
On Error Resume Next
Set acadApp = Interaction.GetObject(, "AutoCAD.Application")
If Err Then
Debug.Print "ERROR " & Err.Number
Debug.Print Err.Description
Debug.Print "starting autocad"
Err.Clear
Set acadApp = New AcadApplication
acadApp.Visible = True
If Err Then
MsgBox Err.Description
Exit Sub
End If
End If