[求助]在vb中打开autocad失败
Option Explicit<BR>Dim AcadApp As autocad.AcadApplicationOn Error Resume Next<BR>Set AcadApp = GetObject("AutoCAD.Application") 此处错误提示:自动化操作时文件名或者类名没有找到<BR>If Err.Number Then<BR> Err.Clear<BR> AcadApp = CreateObject("AutoCAD.Application")<BR> If Err.Number Then<BR> MsgBox "无法打开Autocad" & Err.Description 此处错误提示:对象变量或with块变量未设置
unload me<BR> Exit Sub<BR> End If<BR>End If
AcadApp.Visible = True<BR>AcadApp.WindowState = acMax<BR>AppActivate AcadApp.Caption<BR>End Sub
但是当我没有打开cad时,用set acadapp=new acadappplication 可以打开cad ,请高手指点,谢谢! Set AcadApp = GetObject(,"AutoCAD.Application") 试过了,也不行啊 是不是跟安装有关?我用的是cad2002简化版的 为什么createobject不起作用呢? Dim AcadApp As Object
set AcadApp = CreateObject("AutoCAD.Application") 谢谢您,cad 终于浮出水面了 你的程序中有两个错误:
1.Dim AcadApp As AcadApplication
2.Set AcadApp = GetObject(, "AutoCAD.Application")
页:
[1]