Add-in loaded but does not keep the toolbar

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Add-in loaded but does not keep the toolbar

Post by Robie »

Hi

I have created a .ppa file which when load creates a button with some action to perform. I also have a corresponding .ppt file.

So, first time I open the ppt file and load the add-in. It *creates* the toolbar successfully. I close that ppt file (no other presentations loaded and I don't have Auto_Close defined).

Now, if I open the ppt again, it *doesn't* show the toolbar although the add-in is loaded (from the previous use).

I don't understand why the toolbar is not shown when the presentation is opened for the 2nd time! Any ideas anyone?

I have attached the ppa and ppt files. Any help highly appreciated. The ppa macros contain msgboxes.

Thanks.

Robie
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78442
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Add-in loaded but does not keep the toolbar

Post by HansV »

Why does the toolbar disappear when you close the .ppt?
Best wishes,
Hans

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: Add-in loaded but does not keep the toolbar

Post by Robie »

HansV wrote:Why does the toolbar disappear when you close the .ppt?
Good question - in fact that is my question. I have no idea. I don't have Auto_Close in my .ppa file & I don't remove/delete it at all. I expect it to be there all the time. :hairout:

EDIT: OK. I removed one of my macros and it started working again. Don't understand why but at least I now have something working. I will have to look into why this macro somehow screws it up. :scratch:

User avatar
HansV
Administrator
Posts: 78442
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Add-in loaded but does not keep the toolbar

Post by HansV »

It is not possible to view the code in a .ppa so could you attach the code that you used or the presentation from which you created the .ppa?
Best wishes,
Hans

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: Add-in loaded but does not keep the toolbar

Post by Robie »

HansV wrote:It is not possible to view the code in a .ppa so could you attach the code that you used or the presentation from which you created the .ppa?
Sorry, I thought the last ppt file had all the macros in it. POT and PPA attached.

BTW: Once I have created the ppa file, does the POT/PPA file need the macros for it to work? It seems that way to me. The code I supressed to make it work is called *SetRandomColour4NewTemplate*.
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78442
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Add-in loaded but does not keep the toolbar

Post by HansV »

The toolbar is created by the line

Set oToolbar = CommandBars.Add(Name:=MyToolbar, Position:=msoBarTop, Temporary:=True)

The part Temporary:=True means that the toolbar will automatically be removed when you close PowerPoint. If you change it to Temporary:=False the toolbar will not be removed.
Best wishes,
Hans

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: Add-in loaded but does not keep the toolbar

Post by Robie »

HansV wrote:The toolbar is created by the line

Set oToolbar = CommandBars.Add(Name:=MyToolbar, Position:=msoBarTop, Temporary:=True)

The part Temporary:=True means that the toolbar will automatically be removed when you close PowerPoint. If you change it to Temporary:=False the toolbar will not be removed.
Thanks for that Hans. Yes, now the button stays on screen.

What I don't understand is that do we need to have the macros in the .POT/.PPT file as well as the add-in? At the moment, PPT saved without the macros does not work, i.e. clicking the button does not do anything. It is almost as if I am calling the macro from the PPT file rather than .PPA file.

User avatar
HansV
Administrator
Posts: 78442
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Add-in loaded but does not keep the toolbar

Post by HansV »

The button doesn't do anything at all for me in PowerPoint 2007. Perhaps a PowerPoint expert will be able to shed more light on your problem.
Best wishes,
Hans

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: Add-in loaded but does not keep the toolbar

Post by Robie »

HansV wrote:The button doesn't do anything at all for me in PowerPoint 2007. Perhaps a PowerPoint expert will be able to shed more light on your problem.
Thanks Hans. Ignoring the above problems for time-being, another question based on the requirement from the above :-(.

Is it possible to show & update the 'master slide title' content in the other normal slides? That is, whenever the master slide title changes, it is also reflected in the 'normal slides' ether in a specific text box or (I could use) the 'Footer' (as it is not being used at all in the presentation). For example (I have just added fixed textbox to show how it should look):
master title on normal slides.png
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78442
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Add-in loaded but does not keep the toolbar

Post by HansV »

I suppose you could write code to update the text of these text boxes simultaneously.
Best wishes,
Hans

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: Add-in loaded but does not keep the toolbar

Post by Robie »

HansV wrote:I suppose you could write code to update the text of these text boxes simultaneously.
Interesting but there is no way to know when the TitleMaster 'Title' is being updated or no way to interject when it is updated, i.e. can't get hold of the value of the 'titlemaster title'.

Another problem is that whatever textbox is used in the normal slides to (hopefully) show the titlemaster title, it can't have a macro running underneath to update its content to be *same* as the title master title. At least not that I know of anyway.

User avatar
HansV
Administrator
Posts: 78442
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Add-in loaded but does not keep the toolbar

Post by HansV »

You're correct that you can't update the text box in the slides from the title master. But you could create a macro that
1) Prompts the user for a new title.
2) Sets the text of the title on the title master.
3) Sets the text of the text box in the slide master.
Best wishes,
Hans

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: Add-in loaded but does not keep the toolbar

Post by Robie »

HansV wrote:You're correct that you can't update the text box in the slides from the title master. But you could create a macro that
1) Prompts the user for a new title.
2) Sets the text of the title on the title master.
3) Sets the text of the text box in the slide master.
Thinking out of the box there Hans. Very good - excellent idea. Thanks.