• Powerpoint add-in, load on launch (WinXP / O2003)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Powerpoint add-in, load on launch (WinXP / O2003)

    Author
    Topic
    #423610

    Hi,

    Got concept of add-ins in place for Excel and Word, not sure how they work in Powerpoint.
    Would like a custom commandbar to be created everytime Powerpoint is launched.

    Seems that this can be achieved with this snippet:
    AddIns.Add(“generic.ppa”).Loaded = True

    What puzzles me is where is this line to be placed and where are the .ppa file to be stored.
    eg. in Excel I would place it in add-ins folder, in library folder or in XLstart, in Word for instance in Startup or cross referenced as a template…

    How does this work for powerpoint…

    Thanks,

    Viewing 0 reply threads
    Author
    Replies
    • #970159

      PowerPoint doesn’t automatically load an add-in just because it’s in a special folder; the user will have to install it using Tools | Add-Ins. The default location is C:Documents and SettingsApplication DataMicrosoftAddins (language-dependent)

      See Create an ADD-IN with TOOLBARS that run macros for tips on creating an add-in for PowerPoint.

      • #970160

        Hi Hans,

        To make sure I understand you correctly…

        They work similar to Excel add-ins, but first time usage requires that user checks the add-in from the list box?
        – so contrary to Excel you cannot autoload a menu BEFORE user has checked it?

        What’s then the point of my little piece of code, if user needs to interact anyway? (was cut from the MS help)
        – no facility similar to the auto regsvr32.exe?

        • #970162

          PowerPoint does not have the equivalent of Word’s Startup folder, or Excel’s XLStart folder. So the user will have to load an add-in manually the first time. After that, it will be loaded automatically each time PowerPoint starts. In other words, the line

          AddIns.Add(“generic.ppa”).Loaded = True

          can only be used to load other add-ins from an add-in that has been loaded manually by the user. There may be ways to use a system policy to automate this, but I cannot help you with that.

          • #970166

            Hans,

            As always, thanks a zillion for an answer straight to the point – you just saved me a lot of time and brought some light to one of my dark corners

            ;o)

          • #970169

            OK one more on the same note, I’m afraid.

            When macro is run menu creates nicely and works.
            Made it a .ppa and placed it in add-ins folder, went to “Tools” – “Add-ins”, “Add-new” – added it and checked it. – so far so good.

            Closed powerpoint and relaunched – hoping to see my menu appear (public sub mnuToolbar_add)
            But only a blank space was there where toolbar had been present in earlier F5 – test runs.

            Is there an Autoopen or other type of event that needs to be triggered to call my menu that creates the custom commandbar or how is this sub called?
            Setting the add-in check boc does not seem to be enough – as if I’m still missing one step…

            • #970171

              The article I referred to higher up in this thread explains what you must do: create an Auto_Open macro in the add-in. Please read the article carefully, it contains very useful info.

            • #970172

              Ooops,.

              Got carried away by nearly being there….

              – apologies

            • #970462

              Hi Hans,

              Have read the article(s) carefully and followed it to the point.
              Add-in compiles without problems. PPA is created nicely. It’s registered and checked in the Add’ins box, BUT…
              it does NOT load on Auto_open….(“

            • #970465

              What happens if you replace

              Application.AddIns(“NM_Utilities.ppa”).AutoLoad = msoTrue

              with

              Application.AddIns(“NM_Utilities.ppa”).Loaded = msoTrue

            • #970467

              Nothing I’m afraid… – no change.

            • #970468

              Do you set the Visible property of the toolbar to True explicitly? Toolbars created in code are invisible by default.

            • #970475

              Yep, it’s set to visible = true – line just after the Toolbar.add

            • #970483

              Sorry, no idea then. It works for me.

            • #970531

              Could you attach either the .ppt from which you create the .ppa, or a text file with all relevant code?

            • #970541

              Here you go

            • #970544

              The problem is caused by the line

              Set ShowIs = ActivePresentation

              When PowerPoint is started and the add-in is loaded, there is no active presentation yet, so the code stops executing here, after printing a message in the Immediate window.

              ShowIs isn’t used in the code as posted, so you can remove the above line, or comment it out. When I did this, created an add-in and loaded it, it worked OK.

            • #970547

              You’re right – works here as well. Thanks.

              ShowIs was just there to make sure that I had a hold of “the current” presentation in case there were multiple.
              But as you point out, since it’s on the auto_open it’s not really needed.

              Is a legacy I brought in from Word where I create a custom menu while WOrd is running and other docs, not based on my specific template, may be loaded as well. Didn’t think it would cause problems.

              But… once again it proves that blind copy-paste can be dangerous…

              Anyway – thanks a million

              ;o)

    Viewing 0 reply threads
    Reply To: Powerpoint add-in, load on launch (WinXP / O2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: