Module Module1 Dim AcadApp As Object Dim AcadDoc As Object Dim gridLayer As Object Sub Main() ConnectToAcad() End Sub Sub ConnectToAcad() AcadApp = CreateObject("AutoCAD.Application") AcadApp.Visible = True AcadDoc = AcadApp.ActiveDocument gridLayer = AcadDoc.Layers.Add("网格") AcadDoc.ActiveLayer.color = 5 AcadDoc.ActiveLayer = gridLayer ''''这一句有问题 End Sub End Module