在Excel vba 中引用CATIA后需要将文件另存为,以下是另存的代码,但是运行时无反应,请高手帮忙看看,谢谢
Private Sub CommandButton2_Click()
If MsgBox("要保存文件并关闭吗?", vbYesNo) = vbYes Then
On Error Resume Next
CommonDialog1.Filter = "零件文件|*.CATPart"
CommonDialog1.ShowSave
If oPartDoc.FullName = CommonDialog1.Filename Then
oPartDoc.Save
Else
If Dir(CommonDialog1.Filename) <> "" Then
Kill (CommonDialog1.Filename)
End If
oPartDoc.SaveAs CommonDialog1.Filename
End If
oPartDoc.Close
On Error GoTo 0
End If