AddAdvise error when trying to capture the visEvtCodeWinSelChange event!

Started by Visisthebest, February 27, 2021, 10:25:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Visisthebest

To better understand AddAdvise event capturing I am using the Microsoft sample code in VBA.

It works well but the weird thing is, if I try to capture the selectionchanged event using this approach, with this event code:
visEvtCodeWinSelChange

(https://docs.microsoft.com/en-us/office/vba/api/visio.viseventcodes)

when I run:
Public Sub CreateEventObjects()

I get the error message as attached as screenshot.

Why does it seem AddAdvise doesn't allow me to capture this event using the Microsoft example code:
https://docs.microsoft.com/en-us/office/vba/api/visio.eventlist.addadvise

Otherwise it runs fine, it does capture shape deletes, pages adds and document saves as per the example.

Thank you for your help figuring out this weird issue!

Visio 2021 Professional

Visisthebest

Should've put it on the ActiveWindow.EventList of course my bad.
Visio 2021 Professional

Visisthebest

Visio 2021 Professional