PDA

View Full Version : Solved: Excel Addin AddInInstall()



wagnet
05-11-2006, 03:55 PM
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.


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



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

geekgirlau
05-11-2006, 07:59 PM
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.

Justinlabenne
05-12-2006, 04:17 AM
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.

tpoynton
05-12-2006, 04:28 AM
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.