我试了并没有产生错误啊 CommonDialog1.ShowSave If CommonDialog1.CancelError = True Then MsgBox "cancle", vbOKOnly End If执行上面的代码,点击取消并没有弹出msgbox,cancelerror一直是false
设计时设置CommonDialog1.CancelError = True sub ss() on error goto sserr: ..... exit sub sserr: msgbox "Cancel" end sub
CommonDialog1.ShowSave
If CommonDialog1.CancelError = True Then
MsgBox "cancle", vbOKOnly
End If执行上面的代码,点击取消并没有弹出msgbox,cancelerror一直是false
sub ss()
on error goto sserr:
.....
exit sub
sserr:
msgbox "Cancel"
end sub