下面是我抄的部分代码,可是怎么也新建不了新的文件,单击按钮就不管用,什么反应也没有,加上断点感觉程序也是执行了这几句,但软件就是没反应
* c4 t _3 s& |) ?3 l8 Q2 l+ M# i, i" o8 |! X! u# v8 C( ~6 {
$ B& C7 b9 ?7 E# P E# p( Y& m/ U7 ~ h Dim swapp As SldWorks.SldWorks7 l: a6 Y5 W0 i# q$ o
Set swapp = Application.SldWorks" G! u- D7 L% U# R
Dim swmodel As SldWorks.ModelDoc2
) v) h! Z X7 i [& d1 j k; Q3 f2 o( Y6 | 'Determine which option is selected
; a' m/ W" v# j% W- b% B1 s 'and connect to the modeldoc2 object
/ u) B6 w8 M0 i& n7 c+ l If optPart.Value = True Then
% b" r l0 ?1 T% j6 M Set swmodel = swapp.NewDocument(filedir + "APIPart.prtdot", 0, 0#, 0#)) S2 q2 N! E: h0 }& ?
End If+ Z. i. s8 W5 V$ Z7 C
If optAssy.Value = True Then e; x l- ~+ H) p
Set swmodel = swapp.NewDocument(filedir + "APIassembly.asmdot", 0, 0#, 0#)
! R( S& s' C& R! V; O& L$ e End If
6 E* U# x5 f! u% K( _( I: u If optDraw.Value = True Then
" K# M% e9 U+ S Set swmodel = swapp.NewDocument(filedir + "APIdrawing.drwdot", 0, 0#, 0#)7 z8 H1 c2 Y$ `8 L& B" N; J
End If |