WindowActivate Event is broken

Anthony Berglas 21 Reputation points
2021-07-04T08:40:03.167+00:00

It used to work in Excel 2013. But changing from one window to another no longer seems to fire any event. I am talking about two windows onto the same workbook.

Is there a workaround for this?

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,632 questions
0 comments No comments
{count} votes

Accepted answer
  1. 2021-07-06T17:16:07.197+00:00

    I just tried putting

    Private Sub Workbook_WindowActivate(ByVal Wn As Window)
    MsgBox Application.ActiveWorkbook.Name & " " & Application.ActiveWindow.WindowNumber
    End Sub

    And it fired and shows the window number correctly. So what code are you trying to use?


1 additional answer

Sort by: Most helpful
  1. Tom van Stiphout 1,701 Reputation points MVP
    2021-07-04T21:45:14.037+00:00

    Windows? Please use precise language. Excel is a SDI application (single document interface) so it cannot have multiple "windows" open. Do you mean a single workbook with several worksheets? Or do you mean two instances of Excel, each with one document open.