Results 1 to 3 of 3

Run Mouse Right Click Macro From Add-In

Threaded View

jaslake Run Mouse Right Click Macro... 02-05-2010, 05:57 PM
shg Re: Run Mouse Right Click... 02-05-2010, 06:15 PM
jaslake Re: Run Mouse Right Click... 02-05-2010, 06:35 PM
  1. #1
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Run Mouse Right Click Macro From Add-In

    Hi
    I have a large project that I've been able to move all code from the workbook to an Add-In (except code that's sheet related). I have one module that refuses to run from the Add-In. In this code
    Public Sub Auto_Open()
    With Application.CommandBars("Cell").Controls
            With .Add(temporary:=True)
                .Caption = "Calculate"
                .OnAction = "Calculate"
            End With
        End With
    End Sub
    a "Calculate" command is added to the mouse right click menu. The command is supposed to call this code
    Public Sub Calculate()
        Application.ScreenUpdating = False
        Application.CalculateFull
        Application.ScreenUpdating = True
    End Sub
    If I install both macros in a standard module in the workbook, it works fine. However, if I install the same code in a standard module in the Add-In, the first macro executes and the command is added to the right mouse click menu but when I execute the "Calculate" command from the mouse I get the message that the "Calculate" macro can't be found.

    Am I missing something? All other macros run fine from the Add-In.

    Thanks for your help.
    John

    *** I just discovered that the Add-In code DOES work in Excel 2007 but refuses to work in Excel 2000; any workaround you're aware of?
    Last edited by jaslake; 02-05-2010 at 06:37 PM.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1