提供四种方法: 1、模块写auto_open过程 Sub auto_open() call aa End sub 2、工作簿事件 在ThisWorkBook里写 Private Sub Workbook_Open() call aa End Sub 3、程序级事件 还是在ThisWorkBook里写 Private WithEvents xlApp As Excel.Application Private Sub Workbook_Open() Set xlApp = Application End Sub Private Sub xlApp_WorkbookOpen(ByVal Wb As Workbook) Call aa End Sub 以上,注意你的aa过程,要在模块中 |
|