下面是我抄的部分代码,可是怎么也新建不了新的文件,单击按钮就不管用,什么反应也没有,加上断点感觉程序也是执行了这几句,但软件就是没反应% s' U: y) L# }# k$ G' M
/ h: `7 U- O+ F# B0 M8 b/ v, G5 I8 E3 J0 P8 w& x' ]
Dim swapp As SldWorks.SldWorks
) L- l/ x7 d3 X Set swapp = Application.SldWorks. _; K& m# M: d5 }" B' I6 H
Dim swmodel As SldWorks.ModelDoc2
% _9 }1 C( S9 v& b, j* z( w 'Determine which option is selected
* C- G Y( m7 C \ 'and connect to the modeldoc2 object C% P2 s) b! a+ V# D! c. R9 | Z4 u
If optPart.Value = True Then1 o0 ^3 r- X2 F0 g/ H' _0 @
Set swmodel = swapp.NewDocument(filedir + "APIPart.prtdot", 0, 0#, 0#)
# I R2 o3 c% {4 G End If3 S( x0 h( ^% U( C4 \
If optAssy.Value = True Then8 ?# e6 L/ T1 C* A
Set swmodel = swapp.NewDocument(filedir + "APIassembly.asmdot", 0, 0#, 0#)* ^8 I( h) Q. T+ d- g
End If
8 L0 Q. [ g9 N+ |) o1 j If optDraw.Value = True Then" `. c: @. L5 z/ [$ |3 o; A+ P
Set swmodel = swapp.NewDocument(filedir + "APIdrawing.drwdot", 0, 0#, 0#)7 C0 u( @$ n3 U
End If |