Syntax
Private Sub Workbook_AddinInstall()
Enter
Code
End Sub
This event will run when the specific
workbook is installed as Add-In in Excel.
Example
Private Sub Workbook_AddinInstall()
Dim MyForm As Object
Set MyForm = ActiveWorkbook.VBProject.VBComponents.Add(vbext_ct_MSForm)
   
'Create the User Form
   
With MyForm
       
.Properties("Caption") = "My Form"
       
.Properties("Width") = 450
       
.Properties("Height") = 300
    End
With
End Sub
Result
This example will create a new user form to
whatever workbook is active when the workbook is installed as Add-In in Excel.
It will also assign the new form caption, width and height values.
