Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8536041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:34:21+00:00 2026-06-11T10:34:21+00:00

In my PowerPoint 2010 Addin I subscribed to the CommandBars.OnUpdate event to register movement

  • 0

In my PowerPoint 2010 Addin I subscribed to the CommandBars.OnUpdate event to register movement of shapes and similar events:

 ppt = Globals.ThisAddIn.Application;
 ppt.CommandBars.OnUpdate += CommandBars_OnUpdate;

This works great for some time. However, eventually the event stops being fired. Well, at least the registered event handler is not being called. I couldn’t figure out, what causes this behaviour. It seems a bit indeterministic. No exception is thrown that would appear in the Debug output. It seems, this happens after some time and is not caused by a user action.

I assumed, this would be due to a change of the CommandBars object. So I added a timer, which checked for those changes. But both == and .Equals() comparisons to the last object result in a recognized change every tick, which is very unlikely.

I also tried to refresh the event handler periodically (every 1 minute), but this doesn’t work either:

ppt.CommandBars.OnUpdate -= CommandBars_OnUpdate;
ppt.CommandBars.OnUpdate += CommandBars_OnUpdate;

Does the event really stop after some time? Is there any other method to detect object movement, resize, deletion etc.?


Update

In the meanwhile I restructured the addin. I am now able to reproduce the problem. Here is how:

In the addin’s ribbon I have a button, which calls the method CreateRightEyeCopy() on the ViewModel. In this method another method GetNextPairId() of the ViewModel is called. And this call seems problematic. I changed the GetNextPairId() to immediately return 0 to ensure that the method is the problem.

Here is the resulting stack trace in the return 0 line:

ViewModel.GetNextPairId()
[External Code]
ViewModel.CreateRightEyeCopy()
Button's event handler

I wonder, why there is external code in between my two functions. Can this code cause the OnUpdate event to stop?

If someone’s interested, here is the code of the two functions:

CreateRightEyeCopy():

try
{
    var sel = ppt.ActiveWindow.Selection;
    if (sel.Type == PpSelectionType.ppSelectionShapes)
    {
        foreach (Shape s in sel.ShapeRange)
        {
            var pair = FindStereoPair(s);
            //Only add a new pair, if shape is not in a pair already
            if (pair == null)
            {
                // ** return; **
                int id = GetNextPairId(s.Parent);
                return; //for debugging purposes
            }
        }
    }
}
catch (Exception x)
{
    Debug.WriteLine("Exception occured during creation of stereo pair: " + x.Message);
}

GetNextPairId():

return 0;

If I insert a return statement before the call to GetNextPairId(), then OnUpdate continues.

I also tried to invoke CreateRightEyeCopy() asynchronously, but that doesn’t change anything.

Are there any further thoughts on this issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:34:21+00:00Added an answer on June 11, 2026 at 10:34 am

    Not a real answer but MSDN says: “It is strongly recommended that this event be used primarily for checking that a custom command bar has been added or removed by a COM AddIn.”

    You should probably choose a different approach to track other events.

    As an afterthought, are you sure you are capturing all exceptions (UnhandledException, ThreadException)?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a PowerPoint 2010 AddIn. In a nutshell this is what I do:
I wrote a PowerPoint 2010 addin that allows the user to create pairs of
I'm currently writing an application-level addin for Powerpoint 2010, and my problem is that
Create a simple VSTO Powerpoint 2010 AddIn with 1 toggle button inside the Ribbon.
I need to embed powerpoint viewer with my setup in vs 2010. When user
Is it possible to start a slideshow from a Powerpoint 2010 add-in?
I am working with Delphi(2010), but I'm new with PowerPoint(2010) I've found two codes
I have created a bunch of slides in Powerpoint 2010, and all attempts to
Given a PowerPoint presentation in .ppt format, what is the best way to programmatically
I'm trying to open the Excel file using VBA in Powerpoint 2010 with the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.