Share via

ActivePresentation returns wrong presentation when multiple presentations are open

Anonymous
2014-09-02T12:12:34+00:00

I have got a VBA PowerPoint add-in which has a custom ribbon bar tab.  Many of the options on the ribbon bar use ActivePresentation to get the presentation the user currently has open.

ActivePresentation doesn't appear to work if the user has multiple presentations open though.  In this case, ActivePresentation returns the presentation the user first opened and not the one that they've got open when they click the option on the ribbon bar. It appears as if the add-in is somehow tied to the presentation that launched the add-in.

If I then close the first presentation that was opened, ActivePresentation then works correctly returning the presentation that the user currently has their cursor in.

Has anyone come across this problem?  Is there something I need to do to make the add-in realise that the active presentation is the one that the user currently has the cursor in rather than the one that they initially opened?

TIA

Julie

Microsoft 365 and Office | PowerPoint | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2014-09-03T07:06:25+00:00

I can see how that might happen if the form was still loaded (even if hidden) in a presentation it might activate it when called.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

11 additional answers

Sort by: Most helpful
  1. Anonymous
    2014-09-05T15:20:58+00:00

    I've simply got a form called frmProgressBar and a class called ProgressBar which contains methods to start, update and close the form.

    Ahh! Very nice Julie :-) If someone else reads this, they'll at least know not to use the 32 bit MSO ProgressBar control if they're writing for 64 bit MSO and perhaps you can provide yours as a 3rd party control!

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2014-09-05T09:53:32+00:00

    Hi Jamie

    Yes, I am developing on the 32-bit version of Office 2010.

    I'm not using the ProgressBar control though.  I've simply got a form called frmProgressBar and a class called ProgressBar which contains methods to start, update and close the form.

    I simplified the example code shown above so that it didn't use the class for simplicity sake.

    Julie

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2014-09-05T09:25:03+00:00

    Interesting thread Julie and John. If you're using the ProgressBar control then you'll be developing on a 32 bit version of Microsoft Office. You'll have added a reference for Microsoft Windows Common Controls to the project to be able to use it and it may be worth noting that the mscomctl.ocx library that the control is part of is not available as in MSO 64 bit so the add-in won't work on all versions of PowerPoint.

    Referring to this MSDN article : 

    http://msdn.microsoft.com/en-us/library/office/ee691831(v=office.14).aspx

    Quote :

    "Native 64-bit processes in Office 2010 cannot load 32-bit binaries. This includes the common controls of MSComCtl (TabStrip, Toolbar, StatusBar, ProgressBar, TreeView, ListViews, ImageList, Slider, ImageComboBox) and the controls of MSComCt2 (Animation, UpDown, MonthView, DateTimePicker, FlatScrollBar).These controls were installed by previous versions of Microsoft Office and are installed by 32-bit Office 2010. An alternative must be found for existing Microsoft Office VBA solutions that utilize these controls when the code is migrated to 64-bit Office 2010. 64-bit Office 2010 does not provide 64-bit versions of the Common Controls."

    Needless to say, this is a real pain in the rear for VBA developers! That's why I write my own progress bars from scratch.

    Was this answer helpful?

    0 comments No comments