PyXLL The Python Excel Add-In
  • Product
    • Features
    • Get Started
    • Request Demo
    • Download
  • Pricing
  • Resources
    • Documentation
    • Blog
    • Videos
    • FAQ
    • Learn Python
    • Customer Portal
    • About Us
  • Support
    • Documentation
    • Videos
    • FAQ
    • Contact Us
  • Contact Us
Table of Contents
  • PyXLL Documentation
  • Introduction to PyXLL
  • User Guide
    • Installing PyXLL
    • Configuring PyXLL
      • Python Settings
      • PyXLL Settings
      • License Key
      • Logging
      • Warnings
      • Configuration Variables
      • Environment Variables
      • Startup Script
      • Menu Ordering
      • Shortcuts
      • Default Decorator Parameters
    • Worksheet Functions
    • Macro Functions
    • Real Time Data
    • Cell Formatting
    • Charts and Plotting
    • Custom Task Panes
    • ActiveX Controls
    • Using Pandas in Excel
    • Customizing the Ribbon
    • Context Menu Functions
    • Working with Tables
    • Python as a VBA Replacement
    • Menu Functions
    • Reloading and Rebinding
    • Error Handling
    • Deploying your add-in
    • Workbook Metadata
  • Video Guides and Tutorials
  • API Reference
  • What’s new in PyXLL 5
  • Changelog
Close

Menu Ordering¶

Menu items added via the xl_menu decorator can specify what order they should appear in the menus. This can be also be set, or overridden, in the config file.

To specify the order of sub-menus and items within the sub-menus use a “.” between the menu name, sub-menu name and item name.

The example config below shows how to order menus with menu items and sub-menus.

[MENUS]
menu_1 = 1  # order of the top level menu menu_1
menu_1.menu_item_1 = 1  # order of the items within menu_1
menu_1.menu_item_2 = 2
menu_1.menu_item_3 = 3
menu_2 = 2  # order of the top level menu menu_2
menu_2.sub_menu_1 = 1  # order of the sub-menu sub_menu_1 within menu_2
menu_2.sub_menu_1.menu_item_1 = 1  # order of the items within sub_menu_1
menu_2.sub_menu_1.menu_item_2 = 2
menu_2.menu_item_1 = 2 # order of item within menu_2
menu_2.sub_menu_2 = 3
menu_2.sub_menu_2.menu_item_1 = 1
menu_2.sub_menu_2.menu_item_2 = 2

Here’s how the menus appear in Excel:

Excel menu items with custom ordering.
« Startup Script
Shortcuts »
  • Home
  • Product
  • Features
  • Documentation
  • Download
  • Pricing
  • Support
  • Documentation
  • Videos
  • FAQ
  • Learn Python
  • Contact Us
  • About
  • About Us
  • Legal
  • Blog
© Copyright PyXLL Ltd