CtrlK
BlogDocsLog inGet started
Tessl Logo

pyxll/pyxll-agent-skills

A curated collection of Agent Skills for working with PYXLL, to help AI agents write and understand code using the PyXLL Excel add-in.

99

1.56x
Quality

90%

Does it follow best practices?

Impact

100%

1.56x

Average score across 17 eval scenarios

SecuritybySnyk

Advisory

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

ribbon.mdskills/office-customui-xsd/resources/

Ribbon Structure

Overview

ribbon
  ├─ qat                        Quick Access Toolbar
  │    ├─ sharedControls        Controls for all windows
  │    └─ documentControls      Controls for current document
  ├─ tabs
  │    └─ tab (1–100)
  │         └─ group (0–100)
  │              ├─ [controls]  See controls.md
  │              └─ dialogBoxLauncher (optional)
  └─ contextualTabs
       └─ tabSet (1–100, idMso required)
            └─ tab (0–50)
                 └─ group ...

tab element

Tabs appear in the ribbon at the top of the Excel window.

Attributes:

AttributeDescription
idUnique custom ID (use for new tabs)
idMsoBuilt-in tab ID (use to modify an existing tab)
idQQualified ID for cross-add-in coordination
label / getLabelTab label text
visible / getVisibleShow/hide the tab
keytip / getKeytipAlt-key shortcut (1–3 chars)
insertAfterMso / insertBeforeMsoPosition relative to built-in tab
insertAfterQ / insertBeforeQPosition relative to qualified ID

One of id, idMso, or idQ must be specified.

Common built-in tab idMso values:

  • TabHome, TabInsert, TabPageLayoutExcel, TabFormulas, TabData
  • TabReview, TabView, TabDeveloper, TabAddIns
<!-- New custom tab -->
<tab id="myTab" label="My Tools" insertAfterMso="TabHome">
  ...
</tab>

<!-- Modify existing tab (add a group to Home tab) -->
<tab idMso="TabHome">
  <group id="myGroup" label="My Group">...</group>
</tab>

group element

Groups are the labelled sections within a tab. Controls live inside groups.

Attributes:

AttributeDescription
id / idMso / idQIdentifier
label / getLabelGroup label shown below controls
image / imageMso / getImageIcon for collapsed group
screentip / getScreentipTooltip title
supertip / getSupertipTooltip body
keytip / getKeytipAlt-key shortcut
visible / getVisibleShow/hide
insertAfterMso / insertBeforeMsoPosition within tab
insertAfterQ / insertBeforeQPosition relative to qualified ID
autoScaleboolean — auto-scale contents when tab is narrow
centerVerticallyboolean — vertically center contents

A group may optionally end with a dialogBoxLauncher:

<group id="myGroup" label="Formatting">
  <button id="btn1" label="Bold" .../>
  <dialogBoxLauncher>
    <button id="dlgBtn" label="Format Options" onAction="ShowDialog"/>
  </dialogBoxLauncher>
</group>

Contextual tabs

Contextual tabs appear only when specific content is selected (e.g. a chart or table). They are grouped into tabSet elements identified by idMso.

<contextualTabs>
  <tabSet idMso="TabSetChartTools" visible="true" getVisible="GetChartTabVisible">
    <tab idMso="TabChartToolsDesign">
      <group id="myChartGroup" label="My Chart Tools">
        ...
      </group>
    </tab>
  </tabSet>
</contextualTabs>

tabSet attributes: idMso (required), visible, getVisible.

Quick Access Toolbar (QAT)

<qat>
  <sharedControls>
    <!-- available to all documents -->
    <button id="myQatBtn" label="Quick Run" onAction="my_module.quick_run" imageMso="RunMacro"/>
    <separator id="sep1"/>
    <control idMso="FileSave"/>   <!-- clone built-in -->
  </sharedControls>
  <documentControls>
    <!-- attached to current document only -->
    <button id="docBtn" label="Doc Action" onAction="my_module.doc_action"/>
  </documentControls>
</qat>

QAT allows: control (clone), button, separator.

control in QAT supports: id, idQ, idMso, plus description, size.

separator element

A vertical bar between controls. Used in groups and buttonGroup:

<separator id="sep1"/>

Attributes: id, idQ, tag, visible, getVisible, insertAfterMso, insertBeforeMso, insertAfterQ, insertBeforeQ.

PyXLL: merging multiple ribbon files

Specifying multiple files

The ribbon key in [PYXLL] accepts a single file or a list of files (comma-separated or one per line). All listed files are loaded and merged into one ribbon:

[PYXLL]
; comma-separated
ribbon = base_ribbon.xml, tools_ribbon.xml, reporting_ribbon.xml

; or newline-separated
ribbon =
    base_ribbon.xml
    tools_ribbon.xml
    reporting_ribbon.xml

Paths may be absolute or relative to the pyxll.cfg file. Ribbon files may also be discovered automatically via Python entry points (e.g. from installed packages), in which case they are merged in alongside any files listed in the config.

Merge rules

PyXLL merges all loaded ribbon files by the following rules:

SituationResult
Two tab elements share the same idMerged into one tab; their group children are combined
Two group elements (in the same merged tab) share the same idMerged into one group; their control children are combined
A tab or group has a unique idAppended in file-load order

Use unique IDs for every element you own. If an ID unintentionally matches one from another file or add-in, their contents will be silently merged.

Controlling merge order: insertBefore and insertAfter

To control where an element appears relative to elements from other files, PyXLL recognises two attributes that are not part of the XML schema — PyXLL strips them before sending the final XML to Excel:

AttributeDescription
insertBeforePlace this element before the sibling whose id matches this value
insertAfterPlace this element after the sibling whose id matches this value

Rules:

  • Can be set on tab, group, or any child element of a group
  • Only one of insertBefore or insertAfter may be set on a given element (not both)
  • Values are custom id strings — not idMso values
<!-- file_a.xml: defines a tab with two groups -->
<tab id="MyTab" label="My Tools">
  <group id="AnalysisGroup" label="Analysis">...</group>
  <group id="ToolsGroup"    label="Tools">...</group>
</tab>

<!-- file_b.xml: adds a group between the two groups from file_a.xml -->
<tab id="MyTab">
  <group id="ReportingGroup" label="Reporting" insertBefore="ToolsGroup">
    ...
  </group>
</tab>

Result: the merged MyTab contains AnalysisGroup, then ReportingGroup, then ToolsGroup.

Important distinction: insertBefore/insertAfter (PyXLL merge attributes) are different from the schema's insertBeforeMso/insertAfterMso (which position elements relative to built-in Office controls and are valid XML schema attributes).

README.md

tile.json