+ Reply to Thread
Results 1 to 6 of 6

Add a right click menu item to all workbooks

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Add a right click menu item to all workbooks

    I have a macro that I want to add to my right click menu, and have it available to all workbooks I open. I thought to use the code found at https://www.extendoffice.com/documen...lick-menu.html
    To have it available to all workbooks I thought I could put it in the "this workbook" module of my PERSONAL. However, this doesn't work; the right click context only appears if I unhide PERSONAL and try it on that workbook.

    So, HOW do I get a macro that's saved in my PERSONAL, so always available, to show up in the right-click context menu of all workbooks I open?
    I know I'm not stupid, but I suspect I'm a lot stupider than I think I am

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Add a right click menu item to all workbooks

    .
    You can modify the BLANK EXCEL WORKBOOK TEMPLATE. This is the workbook that appears when you open Excel and click on New (to create a new workbook).
    What you will be doing is creating a blank workbook with your right click menu added, then replacing the existing blank workbook template with yours.

    This resource describes how to replace the existing blank workbook template in Excel :

    https://www.extendoffice.com/documen...-template.html

  3. #3
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Add a right click menu item to all workbooks

    I am pretty sure that events trigger only on the workbook the code is in, hence why it wont run when the personal workbook is hidden. A template may help if the code is placed within it but I doubt itd work retroactively. You could potentially consider writing it as an add-in, that might work though the code would have to be altered (likely alot). See info here as it looks like you can do it via ribbon as well, and the code is mostly without using events. May help you retool it for your needs. Its possible you may need to write your own class to do this.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Add a right click menu item to all workbooks

    If you want it available to all workbooks, you should run the code to add it to the Cell menu once- like the code you have already from Jeff Weir.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  5. #5
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Add a right click menu item to all workbooks

    In the attached workbook launched from xlstart is an addition to the cell menu to add a pre formatted date. All code is within and can be used in any workbook.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Add a right click menu item to all workbooks

    I think I've got it. Here's how I did it:
    1) Added the below, based on Jeff Weir's code from http://dailydoseofexcel.com/archives...xternal-range/, to my Personal in a regular code module:
    Please Login or Register  to view this content.
    2) In the ThisWorkbook module of my Personal, added this to the Workbook_Open() macro:
    Please Login or Register  to view this content.
    so far it appears to be working right.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. A macro to right click a cell and select a item from the right click menu?
    By Peavey in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-13-2014, 10:55 AM
  2. Is it possible add new menu item to right click in pivottable
    By vvickyy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2014, 06:32 AM
  3. New Right-Click Menu Item Issue (Wont Add)
    By Tirren in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-22-2009, 10:27 AM
  4. [SOLVED] Add menu item to right click
    By Dev in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-17-2006, 01:40 PM
  5. Add menu item to right-click menu
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-15-2006, 05:35 AM
  6. [SOLVED] Adding a item to the right click menu?
    By silkworm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-24-2005, 01:28 AM
  7. [SOLVED] How to delete item on right click menu?
    By Bobo in forum Excel General
    Replies: 1
    Last Post: 08-28-2005, 12:05 PM
  8. [SOLVED] Add item to sheet right-click menu?
    By RB Smissaert in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-13-2005, 01:06 PM

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