请教各位一下,现在想实现vb程序把AutoCAD生成的dwg文件插入到excel表格中,代码如何实现啊
Private Sub Command1_Click() Dim acadapp As AcadApplication On Error Resume Next Set acadapp = GetObject(, "AutoCAD.application") If Err Then Err.Clear Set acadapp = CreateObject("AutoCAD.application") If Err Then MsgBox ("不能运行AutoCAD,请检查是否安装了AutoCAD") Exit Sub End If End If acadapp.WindowState = acMax acadapp.Visible = True Dim myfilename As String myfilename = "xxx.dwg" 'dwg文件路径 If Dir(myfilename) <> "" Then acadapp.Documents.Open myfilename Else MsgBox ("文件不存在") End If End Sub
上面代码用AutoCAD打开了dwg文件
接下来选中对象,复制,然后粘贴到excel中如何实现呀?求大神指导,跪谢!