Quantcast
Channel: NetOffice - MS Office in .NET
Viewing all articles
Browse latest Browse all 1741

New Post: Receiving all events twice in Excel COM add in

$
0
0
Hi there,

I'm facing the same issue with a PowerPoint add-in.
This is what I have in constructor and Addin_OnStartupComplete event is firing twice when I open two pptx files IF the second file is opened by double clicking on it in Windows explorer (it doesn't happen if the second file is opened through File -> Open menu in PowerPoint):
        public Addin()
        {
            this.OnStartupComplete += new OnStartupCompleteEventHandler(Addin_OnStartupComplete);
            this.OnDisconnection += new OnDisconnectionEventHandler(Addin_OnDisconnection);
        }
Removing the event handlers for the events OnStartupComplete and OnDisconnection from the constructor didn't worked for me (as it did for Michael in Excel), in my case the Addin_OnStartupComplete event is not fired at all.
I fixed this by implementing a condition to process the Addin_OnStartupComplete event only the first time. Not the best solution, but it's working.

Adrian

Viewing all articles
Browse latest Browse all 1741

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>