Private WithEvents acadApp As AcadApplication Private WithEvents acadDoc As AcadDocument Set acadApp = GetObject(, "AutoCAD.Application") If Err Then Err.Clear Set acadApp = CreateObject("AutoCAD.Application") If Err Then MsgBox "ErrorNumber:" & Err.Number & vbNewLine & "Source:" & Err.Source & vbNewLine & Err.Description, 16 ' "无法运行AutoCAD2000,请检查是否安装了AutoCAD 2000", 16 Set acadApp = Nothing End End If End If acadApp.WindowState = acMax acadApp.Visible = True Set acadDoc = acadApp.Documents.Add '添加文档 acadDoc.Open "c:\aa.dwg"