workbook_open()正常运行,但Workbook_BeforeClose无反应?
在personal.xls的thisworkbook中有两个程序:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
MsgBox "hi!"
End Sub
Private Sub Workbook_Open()
MsgBox "hi!"
End Sub
为何open()的可以正常执行,而beforeclose()完全无反应?
貌似关闭工作表时,完全没有触发beforeclose(),因为在beforeclose()的语句msgbox 前加上追踪点(breakpoint)然后关闭工作表,程序没有在追踪点上面停顿????
[解决办法]
没问题,我试了,可以执行。估计是你哪里设的不对。
[解决办法]
我试的代码:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
MsgBox "hihi!"
End Sub
Private Sub Workbook_Open()
MsgBox "hi!"
End Sub