Consulting

Results 1 to 6 of 6

Thread: Solved: PPT 2003 Add-in does not work

  1. #1
    VBAX Regular
    Joined
    Jul 2008
    Posts
    29
    Location

    Solved: PPT 2003 Add-in does not work

    I have written a macro that creates a toolbar with 3 buttons, and a macro for each button. I save it as a .ppa, and add it via Tools > Add Ins. Works fine with me.

    Then I send the .ppa to someone else and have them add it via Tools > Add Ins, but now it does not work

    Any suggestions?

    /evamads

  2. #2
    VBAX Regular
    Joined
    Jul 2008
    Posts
    29
    Location
    Oh, forgot to mention that macro security is Low...

  3. #3
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    Maybe post some code??
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  4. #4
    VBAX Regular
    Joined
    Jul 2008
    Posts
    29
    Location
    Sure:

    Module1:
    Dim aEventClass As egaEventClass
    Sub Auto_Open()
    Set aEventClass = New egaEventClass ' Hook Application events i Class_Initialize
    End Sub

    Class Module egaEventClass:

    Public WithEvents App As Application
    Private Sub App_NewPresentation(ByVal Pres As Presentation)
    ' MsgBox "Makroen kører"
    On Error Resume Next
    Application.CommandBars("GF speciel").Delete
    On Error GoTo 0
    Application.CommandBars.Add Name:="GF speciel", Position:=msoBarFloating, temporary:=True

    With Application
    .CommandBars("GF speciel").Visible = True
    End With

    Set newItem1 = CommandBars("GF speciel").Controls.Add(Type:=msoControlButton)
    With newItem1
    .BeginGroup = False
    .Caption = "Nyt afsnitsdias"
    .OnAction = "NytAfsnitDias"
    .TooltipText = "Nyt afsnit dias"
    .Style = msoButtonCaption
    End With
    Set newItem2 = CommandBars("GF speciel").Controls.Add(Type:=msoControlButton)
    With newItem2
    .BeginGroup = False
    .Caption = "Nyt tekst dias"
    .OnAction = "NytTekstDias"
    .TooltipText = "Nyt tekst dias"
    .Style = msoButtonCaption
    End With
    Set newItem3 = CommandBars("GF speciel").Controls.Add(Type:=msoControlButton)
    With newItem3
    .BeginGroup = False
    .Caption = "Fjern punkttegn"
    .OnAction = "RemoveBullet"
    .TooltipText = "Fjern punkttegn"
    .Style = msoButtonCaption
    End With
    End Sub
    Private Sub Class_Initialize()
    Set App = Application ' Hook events
    End Sub

    ... the big question is, why does it run on my computer and not on the other?

    /evamads

  5. #5
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    Is there some reason to use Class modules? (maybe something I can't see here)

    In any case you don't need them to create the toolbar.

    Also Declare the CommandBar Button variables

    Try this

    [VBA]Dim NewItem1 As CommandBarButton
    Dim NewItem2 As CommandBarButton
    Dim NewItem3 As CommandBarButton



    Sub auto_open()
    On Error Resume Next
    Application.CommandBars("GF speciel").Delete
    On Error GoTo 0
    Application.CommandBars.Add Name:="GF speciel", Position:=msoBarFloating, temporary:=True

    With Application
    .CommandBars("GF speciel").Visible = True
    End With

    Set NewItem1 = CommandBars("GF speciel").Controls.Add(Type:=msoControlButton)
    With NewItem1
    .BeginGroup = False
    .Caption = "Nyt afsnitsdias"
    .OnAction = "NytAfsnitDias"
    .TooltipText = "Nyt afsnit dias"
    .Style = msoButtonCaption
    End With
    Set NewItem2 = CommandBars("GF speciel").Controls.Add(Type:=msoControlButton)
    With NewItem2
    .BeginGroup = False
    .Caption = "Nyt tekst dias"
    .OnAction = "NytTekstDias"
    .TooltipText = "Nyt tekst dias"
    .Style = msoButtonCaption
    End With
    Set NewItem3 = CommandBars("GF speciel").Controls.Add(Type:=msoControlButton)
    With NewItem3
    .BeginGroup = False
    .Caption = "Fjern punkttegn"
    .OnAction = "RemoveBullet"
    .TooltipText = "Fjern punkttegn"
    .Style = msoButtonCaption
    End With

    End Sub
    [/VBA]
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  6. #6
    VBAX Regular
    Joined
    Jul 2008
    Posts
    29
    Location
    It works ! Thank you very much for your help.

    ... and no, there is no reason to use the class module (just was not sure).

    /evamads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •