Trap close window

In Excel, you can open several windows to view the same workbook:

  • manually View >New Window
  • or programmatically ThisWorkBook.NewWindow, etc.

You can then block the window activation change through the event Workbook_WindowDeactivate(ByVal Wn As Window).

But is there a way in Excel VBA to detect if a user is trying to close a specific window?

Please note that this is not the same as closing the entire book.

+4
source share
1 answer

MSDN Excel 2007, " Windows Application ..." (ref , MSDN. , "Window Object" MSDN).

, , Application.Windows. , , , .

0

All Articles