Consulting

Results 1 to 4 of 4

Thread: Solved: Excel Addin AddInInstall()

  1. #1
    VBAX Regular
    Joined
    Jan 2006
    Posts
    20
    Location

    Solved: Excel Addin AddInInstall()

    My AddinInstall() isn't executing when I install the AddIn.

    There are two modules. Module2 contains the SCQFormOld macro. Module1 is below.

    Any ideas why the AddinInstall isn't creating the ToolBar when the Addin is installed? While in VBA, I can execute Workbook_AddinInstall() and it builds the ToolBar.

    [VBA]
    Private Sub Workbook_AddinInstall()
    Application.CommandBars.Add(Name:="SCQForm").Visible = True

    With Application.CommandBars("SCQForm").Controls.Add
    .FaceId = 364
    .Tag = "SCQ Form V2"
    .Caption = "SCQ Form V2 -> OSum V1"
    .OnAction = "SCQFormOld"
    End With

    Application.StatusBar = "Addin Successful. SCQForm Toolbar now available."
    End Sub
    Private Sub Workbook_AddinUninstall()
    For Each bar In Application.CommandBars
    If Not bar.BuiltIn And bar.Name = "SCQForm" Then bar.Delete
    Next
    End Sub

    [/VBA]

    Edited by GeekGirlau 12-May-06. Reason: insert vba tags

  2. #2
    Moderator VBAX Master geekgirlau's Avatar
    Joined
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,464
    Location
    Hi Wagnet,

    I've edited your post to put vba tags around the code to make it easier to read. When you paste (or type) code into a post, select all the code text and click on the "VBA" button.

  3. #3
    VBAX Mentor Justinlabenne's Avatar
    Joined
    Jul 2004
    Location
    Clyde, Ohio
    Posts
    408
    Location
    Is your code in the ThisWorkbook code module?

    Most likely it is, but it is possible to have the same code and manually execute it even if it's not in the right module.
    Justin Labenne

  4. #4
    VBAX Mentor tpoynton's Avatar
    Joined
    Feb 2005
    Location
    Clinton, MA
    Posts
    399
    Location
    I think that the code posted above is in Module1; put that code in ThisWorkbook and it should work as it does when manually executed upon installation.

Posting Permissions

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