Private WithEvents App As Application
Private Sub Workbook_Open()
Set App = Application
End Sub
在一个模块中:
Private Sub App_WorkbookOpen(ByVal Wb As Workbook)
MsgBox "New Workbook: " & Wb.Name
'or better check here if this is your workbook and activate the addin
End Sub
1条答案
按热度按时间ars1skjm1#
您可以使用应用程序事件(请参阅Chip Pearson's website)。
将此代码放入
PERSONAL.XLSM
的This Workbook
模块中(参见here)。在一个模块中: