No context menu in excel

I am using the «Custom UI Editor For Microsoft Office». I have added an «Office 2007 Custom UI Part» which creates the «customui.xml» file for me. It currently has the following code which adds my «Zoom Cell» button to the developer tab.

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">  
  <ribbon>  
    <tabs>  

      <tab idMso="TabDeveloper" >  
        <group id="customGroup1" label="Zoom" insertAfterMso="GroupModify">  

          <button id="customButton1" label="Zoom Cell" size="large" onAction="ZoomCell" imageMso="ZoomPrintPreviewExcel" />

        </group>  
      </tab>  

    </tabs>  
  </ribbon>
</customUI>

What I am trying to do is add the same button basically to the context menu for right-clicking on a cell; however, it is not working for me. If I modify the code even the button from the above code gets removed. Here is what I have tried. I am pretty sure that there is something weird in my xml code; I just can’t find it.

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">  
  <ribbon>  
    <tabs>  

      <tab idMso="TabDeveloper" >  
        <group id="customGroup1" label="Zoom" insertAfterMso="GroupModify">  

          <button id="customButton1" label="Zoom Cell" size="large" onAction="ZoomCell" imageMso="ZoomPrintPreviewExcel" />

        </group>  
      </tab>  

    </tabs>  
  </ribbon>
  <contextMenus>
   <contextMenu idMso="ContextMenuCell">
    <button id="MyButton" label="Zoom Cell" onAction="ZoomCell" imageMso="ZoomPrintPreviewExcel" insertBeforeMso="Cut" />
   </contextMenu>
  </contextMenus>
</customUI>

asked Jul 8, 2014 at 20:28

Sean W.'s user avatar

Sean W.Sean W.

8635 silver badges13 bronze badges

When I put your code in the CustomUI Editor and try to validate it, I get an error that «contextMenus» is not supported element in the CustomUI namespace, followed by a list of expected/allowable elements:

enter image description here

Allowable elements are:

  • qat
  • officeMenu
  • contextualTabs

It seems from THIS LINK (which is for Outlook, but I believe the approach would be same/similar for Excel/etc.) that context Menus are manipulated through VBA events in Office 2007.

I think that RibbonUI manipulation of context menus was not introduced until 2010.

answered Jul 8, 2014 at 22:16

David Zemens's user avatar

David ZemensDavid Zemens

52.8k11 gold badges79 silver badges129 bronze badges

Excel for Microsoft 365 Excel 2016 Excel 2013 More…Less

Last Updated: August 30, 2019

ISSUE

If you have customized Excel’s right-click context menu (possibly using an add-in), you may discover that the New Comment, and New Note options are missing after you update Office.

Image of Excel's right-click context menu

STATUS: WORKAROUND

To fix this, reset your customized context menus using VBA (Visual Basic for Applications). 

Follow these steps to implement the workaround:

  1. Open the Visual Basic Editor (VBE) by pressing Alt+F11.

  2. Insert a new module from Insert > Module.

  3. Copy and paste the following code into the empty module pane on the right:

    Sub ShowButtonsAgain()
       Dim bar As CommandBar
       For Each bar In Application.CommandBars
             bar.Reset
       Next
    End Sub

  4. Press F5 to run the code.

  5. Exit back to Excel by pressing Alt+Q, and verify that the Comment and Note options have been restored.

If the issue recurs, then you can create a reusable procedure:

  1. Follow steps 1-5 above.

  2. Save the workbook in a convenient location where you can quickly access it if needed. Alternately, you can save it in Excel’s Personal Macro Workbook if you always want to have the procedure available.

More Resources

Icon Experts (brain, gears)

Ask the experts

Connect with experts, discuss the latest Excel news, updates, and best practices, and read our blog.

Excel Tech Community

Icon Community

Get help in the community

Ask a question and find solutions from Support Agents, MVPs, Engineers, and other Excel users.

Excel Forum on Answers

Icon feature request (light bulb, idea)

Suggest a new feature

We love reading your suggestions and feedback! Share your thoughts. We’re listening.

Provide feedback

See Also

Fixes or workarounds for recent issues in Excel for Windows

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Please Note:
This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Problem with Missing Context Menu Option.

Written by Allen Wyatt (last updated July 28, 2022)
This tip applies to Excel 2007, 2010, 2013, and 2016


Rita has encountered a situation at her workplace that has her scratching her head. They have an employee who can right-click on any cell and the Format Cells option is not available on the resulting Context menu. Rita is wondering what is necessary to get the Context menu option back.

It is possible that the Context menu that is displayed when you right-click on a cell has, over time, become modified in some way. You can reset this particular Context menu by using a very simple macro:

Sub ResetContextMenu()
    CommandBars("Cell").Reset
End Sub

If this does not do the trick, or if the menu inexplicably changes at some future point, the culprit could very well be some sort of add-in or a particular macro in a workbook. Determining which of the macros is doing the modification can take some serious detective work. If you can access the macros in the add-in or workbook, you might want to just search through the VBA code to see if you can find the text «CommandBars» to see what is being changed.

If you cannot access the macro code (perhaps the add-in or workbook is protected), then you will need to go through a trial-and-error process where you stop the loading of the add-ins, one by one, until you determine which one causes a change in the Context menu.

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I’ve prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training.
This tip (11786) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Problem with Missing Context Menu Option.

Author Bio

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. Learn more about Allen…

MORE FROM ALLEN

Spreading Out a Table

If someone sends you a worksheet that has lots of data in it, you might want to «spread out» the data so you can have …

Discover More

Displaying a PivotTable’s Name in the PivotTable

When you create a PivotTable, it can have a name. You may want this name to appear within the PivotTable itself. There is …

Discover More

Inserting Cells in a Table

You can enlarge a table by adding cells where they are needed. Just pick where you want the cells inserted, then use the …

Discover More

More ExcelTips (ribbon)

Turning Off Paste Options

Paste some information into a worksheet and Excel helpfully displays some options related to the paste operation. If you …

Discover More

Disabling Page Layout View

Excel allows you to display your workbooks using a couple of different views. If you want to disable one of the views, it …

Discover More

Turning Off Insert Options

When you insert rows, columns, or cells in a worksheet, does the resulting Insert Options icon bother you? Here’s how to …

Discover More

I have the following issue: When right clicking in a row or column in Excel 2010 no menu is appearing. In Excel 2003 right clicking in a row lets you insert/delete rows.

Do you know if this functionality does not exist in Excel 2010 or if my Excel installation is problematic and what I need to do to resolve this?

Update: I am using Windows 7 64 bit and my Office is the Home and Business Edition.

iglvzx's user avatar

iglvzx

23.3k13 gold badges85 silver badges122 bronze badges

asked Nov 22, 2011 at 18:20

Financial Economist's user avatar

2

Hit Alt+F11 to get to the VBE.
Hit Ctrl+G to see the immediate window.

Enter the following

application.CommandBars("Cell").Reset
application.CommandBars("cell").Enabled = True
application.CommandBars("Column").Reset
application.CommandBars("column").Enabled = True
application.CommandBars("Row").Reset
application.CommandBars("row").Enabled = True

Alt+F11 to return to Excel.

zx485's user avatar

zx485

2,17011 gold badges17 silver badges23 bronze badges

answered Dec 19, 2014 at 20:41

Wiesshund's user avatar

1

Start Excel in safe mode and see if the problem persists. It may be an add-in that is stealing the functionality.

To open Excel in safe mode, find an Excel document, and hold down Ctrl when double-clicking on it. You should be prompted to open in Safe Mode.


EDIT: There’s a VBA macro you can use from this site, which will apparently restore right-click behaviour:

Sub SwitchOnCutAndPaste()

EnableControl 21, True
EnableControl 19, True
EnableControl 22, True
EnableControl 755, True

End Sub

Sub EnableControl(Id As Integer, Enable As Boolean)

Dim CB As CommandBar
Dim CBC As CommandBarControl

For Each CB In Application.CommandBars
    Set CBC = CB.FindControl(Id:=Id, recursive:=True)
    If Not CBC Is Nothing Then CBC.Enabled = Enable
Next

End Sub

answered Nov 23, 2011 at 6:08

3

This worked for me:

Hit Alt+F11 to get to the Visual Basic Editor, hit Ctrl+G to see the immediate window, and enter the following:

Application.CommandBars("cell").Enabled = True
Application.CommandBars("Ply").Enabled = True
Application.CommandBars("row").Enabled = True
Application.CommandBars("column").Enabled = True

Alt+F11 to return to Excel.

«ply» is the code used to enable right click of worksheet tabs.

G-Man Says 'Reinstate Monica''s user avatar

answered Apr 30, 2015 at 4:55

Sargam's user avatar

It is the windows profile issue — log in as administrator rename old profile as .old and log in as user to recreate the new windows profile fix the problem.

answered Aug 18, 2017 at 11:06

Kevin072's user avatar

1

For a complete fix across cell, row, column, tab I needed a composite of this:

application.CommandBars("Cell").Reset
application.CommandBars("cell").Enabled = True
application.CommandBars("Column").Reset
application.CommandBars("column").Enabled = True
application.CommandBars("Row").Reset
application.CommandBars("row").Enabled = True
Application.CommandBars("Ply").Reset
Application.CommandBars("ply").Enabled = True

zx485's user avatar

zx485

2,17011 gold badges17 silver badges23 bronze badges

answered May 11, 2020 at 10:17

Nigel Haskins's user avatar

I got a similar issue. It turned out the sheet was password-protected, and I did not have the password. So I just created a new worksheet and pasted there all contents from the protected sheet. It worked. Now I can right-click, change column width, insert etc.

answered Sep 6, 2022 at 20:37

Leo's user avatar

Users who use Microsoft Office are familiar with the significance of Excel Worksheet. Excel offers a range of functionalities that allow users to organize data and perform financial analysis. It is frequently used by small and large organizations for data entry and financial calculations. With its built-in functions, Excel makes accounting easy. For instance, the SUMPRODUCT function multiplies the number of cells or arrays and returns a sum of products.

In this context, we will not delve into how this function works but will focus on how to restore the Microsoft Excel Worksheet option to the desktop right-click context menu.

To create a new Excel Worksheet, you can follow these steps:-

Step 1. Right-click on the Desktop of your computer.

Step 2. Next, select “New” from the context menu.

Step 3. From the submenu, choose “Microsoft Excel Worksheet.”

This will create a new Excel Worksheet, which you can then process as needed.

By following these simple steps, you can easily create a new Excel Worksheet and begin working on your data. This method can be especially useful if you frequently work with Excel and want to quickly create a new worksheet without having to open Excel first. It can also be a convenient way to organize your files directly from the Desktop of your computer.

Many users have experienced the common issue of not being able to locate the Microsoft Excel Worksheet option when attempting to create a new file. This problem can occur when you right-click on a free area of your Windows 10 Desktop or in a folder and select “New.” If you are facing this issue, rest assured that you are not alone.

If you find that the Microsoft Excel Worksheet option is missing from the context menu when you right-click on a free area of the Windows 10 desktop or in a folder and select New, there could be various reasons behind it. It is possible that a third-party software may have altered the registry keys, which can cause this issue. To resolve this problem, registry hacks can be utilized.

One helpful resource for fixing the missing Excel option in the right-click context menu is the gearupwindows article. This article provides detailed instructions and steps to help you resolve the issue and restore the Excel Worksheet option in the context menu. By following the guide, you can easily fix the problem and avoid any further complications.

This procedure involves a registry hack; hence, we recommend taking full back of Windows Registry and creating a system restore point. Furthermore, one should note that this procedure will work for MS Office 2007 and later versions.

Step 1. Press Windows logo + R keys simultaneously to open the Run command box.

Step 2. Type regedit in the Run box and hit Enter or press OK to open the Registry Editor.

Step 3. Navigate to the following path in the Registry Editor:-

HKEY_CLASSES_ROOT.xlsxExcel.Sheet.12ShellNew

Step 4. On the right side pane of the ShellNew key, double-click on the FileName string to change its Value data.

Note: If you don’t see the FileName string on the opposite side of the ShellNew key, then right-click on the ShellNew, select New, and then the String Value option.

Step 5. Replace the default Value data with the following:-

excel12.xlsx

Note: You can also use an absolute path, in place of excel12.xlsx, like:-

C:Program Files (x86)Microsoft OfficeRootVFSWindowsShellNewexcel12.xlsx

Step 6. Click OK.

Step 7. Close the Registry Editor.

Once you complete the above steps, right-click on the free space of the Windows 10 Desktop and navigate to New > Microsoft Excel Worksheet; you will see the option in the right-click context menu. You can now open Excel Worksheet by right-clicking on the Desktop or in any Folder.

That’s all!!!

Понравилась статья? Поделить с друзьями:
  • No change to base word
  • Nice word for good friend
  • No cell border in excel
  • Nice word for girls
  • No breaking space word