Hi Aju,
I didn't open your file, but I think you should be aqble to do the
following.

Create a sub in a standard module, such as:
Sub ShowForm ()
    FormName.Show
End Sub

Then in your OnAction event, specify the above procedure.

Asa

-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Aju Chacko
Sent: Sunday, March 11, 2012 10:08 PM
To: excel macro forum
Subject: Fwd: $$Excel-Macros$$ Macro inside 'add-in' not running while
executing button in add-in tab

Please help the code reside inside the add-in module & the password
for add-in is 'parettu'

---------- Forwarded message ----------
From: Aju Chacko <[email protected]>
Date: Sun, 11 Mar 2012 21:48:35 +0530
Subject: $$Excel-Macros$$ Macro inside 'add-in' not running while
executing button in add-in tab
To: excel macro forum <[email protected]>

Dear experts,
                       I have a problem with an add-in created.The code
given below is being used for automatically install add-in  excel *(kept in
inside Thisworkbook module of add-in)*. 'On action ' command is used for
specifying macro that  is to be run when Add-in control in excel ribbon is
pressed.I used the code below in several other add-ins successfully.But in
this macro a form called '*Form_Consolidate'* has to be shown as soon as
macro is being executed.Kindly advice me which module inside add-in to be
specified in On action command .Thanking u in advance for help
                                                                    Aju v
chacko


*Dim InstalledProperly As Boolean*
*Dim cControl As CommandBarButton*
*
*
*Private Sub Workbook_AddinInstall()*
*
*
*Dim iContIndex As Integer*
* *
*
*
*    On Error Resume Next 'Just in case*
*
*
*    'Delete any existing menu item that may have been left*
*
*
*    Application.CommandBars("Worksheet Menu Bar").Controls("Consolidation
Tool").Delete*
*
*
*
*
*
*
*    'Pass the Index of the "Format" menu item number to a Variable.*
*
*
*    'Use the FindControl Method to find it's Index number. ID number   is
used in case of Customization*
*
*
*    iContIndex = Application.CommandBars.FindControl(ID:=30006).Index*
*
*
*
*
*
*
*    'Add the new menu item and Set a CommandBarButton Variable to it.*
*
*
*    'Use the number passed to our Integer Variable to position it.*
*
*
*    Set cControl = Application.CommandBars("Worksheet Menu
Bar").Controls.Add(Before:=iContIndex)*
*
*
*
*
*
*
*    'Work with the Variable*
*
*
*        With cControl*
*
*
*            .Caption = "Consolidation Tool"*
*
*
*            .Style = msoButtonCaption*
*
*
*            .OnAction = "UserForm_Initialize"*
*
*
*            'Macro stored in a Standard Module*
*
*
*        End With*
*
*
*    On Error GoTo 0*
*    InstalledProperly = True*
*
*
*End Sub*
*
*
*Private Sub Workbook_AddinUninstall()*
*
*
*On Error Resume Next 'In case it has already gone.*
*
*
*    Application.CommandBars("Worksheet Menu Bar").Controls("Consolidation
Tool").Delete*
*    *
*    On Error GoTo 0*
*
*
*End Sub*
*
*
*Private Sub Workbook_Open()*
*    Dim ai As AddIn, NewAi As AddIn*
*    Dim M As String*
*    Dim otempbk As Workbook*
*    'Was just installed using the Add-Ins dialog box?*
*    If InstalledProperly Then Exit Sub*
*    'Is it in the AddIns collection?*
*    For Each ai In AddIns*
*        If ai.Name = ThisWorkbook.Name Then*
*                 If ai.Installed Then*
*                    Exit Sub*
*                End If*
*         End If*
*    Next ai*
*    'It's not in AddIns collection, prompt user.*
*     addname = ThisWorkbook.FullName*
*     Set otempbk = Workbooks.Add*
*     ' Add it to the AddIns collection and install it.*
*     Set NewAi = AddIns.Add(Filename:=addname)*
*     NewAi.Installed = True*
*     MsgBox ("Add-in consolidation scucessfully installed")*
*     otempbk.Close*
*End Sub*

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like
Please Help, Urgent, Need Help, Formula Problem, Code Problem, and
Need Advice will not get quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security
measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum
in signatures are prohibited.

NOTE  : Don't ever post personal or confidential data in a workbook.
Forum owners and members are not responsible for any loss.

----------------------------------------------------------------------------
--------------------------
To post to this group, send email to [email protected]

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security
measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.

----------------------------------------------------------------------------
--------------------------
To post to this group, send email to [email protected]

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to [email protected]

Reply via email to