我像这样进入工作簿打开事件:
Private WithEvents App As Application ' For handling events
' Event handler for when THIS workbook is opened.
Private Sub Workbook_Open()
Set App = Application ' Set App variable so we can add event handlers
App.EnableEvents = True ' Set raise events = true.
End Sub
' Event handler to handle the event when a new workbook is open (ie. when Raven Viewer exports to a new workbook in excel
Private Sub App_WorkbookOpen(ByVal Wb As Workbook)
Wb.Windows(1).Visible = False
End Sub
它隐藏了在此电子表格打开时打开的所有工作簿......但在短时间内,它们对用户可见。有什么办法可以防止这种情况吗?
我试图防止当前打开的工作簿失去任何焦点。
工作簿未使用 VBA 打开。
谢谢。