question

AnthonyBerglas-2645 avatar image
0 Votes"
AnthonyBerglas-2645 asked AnthonyBerglas-2645 commented

WindowActivate Event is broken

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-vba-devoffice-vsto-com-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BobLarson-6601 avatar image
0 Votes"
BobLarson-6601 answered AnthonyBerglas-2645 commented

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for that. There was an obscure reason why it stopped working for Office 365 and I fumbled a test. Looking harder found it.

Not an Excel bug.

0 Votes 0 ·
TvanStiphout avatar image
0 Votes"
TvanStiphout answered AnthonyBerglas-2645 commented

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.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Um, I am talking about the WindowActivate Event moving between two windows onto the same workbook. One Excel process.

Open a workbook. Select View > New Window. You will get two windows onto the same workbook. An ancient feature.

0 Votes 0 ·