[求助]一个很菜的问题,高手请进!
Private Sub Command1_Click()<BR>On Error Resume Next<BR>Dim dwgname As String<BR>dwgname = "c:\Test.dwg" '测试用,事先画一张Test.dwg<BR>If Dir(dwgname) <> "" Then<BR> Dim acadApp As AcadApplication<BR> Set acadApp = GetObject(, "AutoCAD.Application.14") <FONT color=#22dd92> <FONT color=#39de10> '原先测试时是(,"AutoCAD.Application"),程序可以运行</FONT><BR></FONT> If Err Then<BR> Err.Clear<BR> Set acadApp = CreateObject("AutoCAD.Application.14")<BR> If Err Then<BR> MsgBox Err.Description<BR> Exit Sub<BR> End If<BR> End If<BR> <BR> Dim acadDoc As AcadDocuments<BR> Set acadDoc = acadApp.Documents<BR> acadDoc.Open (dwgname)<BR> acadApp.Visible = True<BR> acadApp.ZoomExtents<BR>Else<BR> MsgBox "文件" & dwgname & "不存在,"<BR>End If<BR>End Sub原程序在第7行时是Set acadApp = GetObject(, "AutoCAD.Application"),该程序可以通过AutoCAD2002打开图纸Test.dwg,现因某些原因需要通过AutoCAD R14来打开图纸。(系统中装有CAD2002和CAD-R14) ,但做了相应更改后,程序报错:类型不匹配!请问这是什么原因?? <FONT color=#22dd92> <FONT color=#39de10> </FONT></FONT> AutoCAD.Application.15是cad2002,AutoCAD.Application.16是cad2004,至于R14,应该是什么呢?我也不大清楚啦! 不要带版本号 不带版本号的话,直接用cad2002打开文件了。我希望限定cadR14,该怎么办 顶一下,希望大家多多帮助
页:
[1]