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

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

Attributes Reference

ID attributes

Every control needs exactly one of id, idMso, or idQ.

AttributeTypeDescription
idST_UniqueIDCustom unique ID. Must be unique across the entire customUI XML file. Max 1024 chars.
idMsoST_IDBuilt-in control ID. Use to reference or modify an existing Office control.
idQST_QIDQualified ID in the form prefix:name where prefix maps to your namespace. Allows multiple add-ins to reference the same custom control.
tagST_StringArbitrary string data attached to the control. Accessible in callbacks. Max 1024 chars.

Qualified IDs example:

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"
          xmlns:myaddin="MyAddInNamespace">
  <ribbon>
    <tabs>
      <tab idQ="myaddin:MyTab" label="Shared Tab">
        ...
      </tab>
    </tabs>
  </ribbon>
</customUI>

Another add-in can then add controls to myaddin:MyTab by referencing idQ="myaddin:MyTab".

Position attributes

Controls positioning within their parent container. These are mutually exclusive — use only one.

AttributeDescription
insertAfterMsoPlace after a built-in control with this idMso
insertBeforeMsoPlace before a built-in control with this idMso
insertAfterQPlace after a control with this qualified ID
insertBeforeQPlace before a control with this qualified ID

Label attributes

AttributeTypeDescription
labelST_String (max 1024)Static label text
getLabelcallbackDynamic label: def cb(control) -> str

Image attributes

Only one of image, imageMso, or getImage may be specified.

AttributeTypeDescription
imageST_Uri (max 1024)Path to a custom image resource
imageMsoST_IDID of a built-in Office icon (e.g. "RunMacro", "FileSave")
getImagecallbackDynamic: def cb(control) -> IPictureDisp
showImagebooleanWhether to display the image (default true)
getShowImagecallbackDynamic: def cb(control) -> bool

Common imageMso values: RunMacro, FileSave, FileOpen, FilePrint, Undo, Redo, Cut, Copy, Paste, Bold, Italic, Underline, FormatCells, OptionsDialog, Refresh, Close, Help, HappyFace, SadFace, SelectAll, Find, Replace, Sort, Filter

Custom images with PyXLL: Set loadImage="pyxll.load_image" on the customUI root element, then use image="filename.png" on controls. pyxll.load_image handles PNG transparency correctly. For package resources use image="module:resource_name". Without pyxll.load_image, Excel's built-in image handler is used and PNG transparency may not render correctly.

Tooltip attributes

AttributeTypeDescription
screentipST_String (max 1024)Short tooltip title shown on hover
getScreentipcallbackDynamic screentip
supertipST_String (max 1024)Long tooltip body shown on hover
getSupertipcallbackDynamic supertip

Keytip attributes

AttributeTypeDescription
keytipST_Keytip (1–3 chars, no whitespace)Alt-key navigation shortcut
getKeytipcallbackDynamic keytip

Visibility and enabled state

AttributeTypeDescription
visiblebooleanWhether the control is shown
getVisiblecallbackDynamic: def cb(control) -> bool
enabledbooleanWhether the control is interactive
getEnabledcallbackDynamic: def cb(control) -> bool

Show label

AttributeTypeDescription
showLabelbooleanWhether to show the label text on the control
getShowLabelcallbackDynamic: def cb(control) -> bool

Size attribute (buttons and galleries in groups)

AttributeValuesDescription
size"normal" or "large"Large = tall button with image above label
getSizecallbackDynamic size: def cb(control) -> str

Callback values in PyXLL

In PyXLL, all callback attribute values are Python function name strings in module.function format. The module must be importable from the Python path:

<button id="myBtn" onAction="my_module.on_click"/>
<customUI loadImage="pyxll.load_image" onLoad="my_module.on_load"/>

The control parameter passed to most callbacks is an IRibbonControl object with:

  • control.Id — the control's id attribute value
  • control.Tag — the control's tag attribute value
  • control.Context — the active window

The onLoad callback on customUI is the exception — it receives an IRibbonUI object (not IRibbonControl). Store it to invalidate control state:

_ribbon = None

def on_load(ribbon_ui):          # ribbon_ui is IRibbonUI
    global _ribbon
    _ribbon = ribbon_ui

def refresh():
    if _ribbon:
        _ribbon.Invalidate()
        # or: _ribbon.InvalidateControl("myControlId")
        # or: _ribbon.ActivateTab("myTabId")

Action callbacks

AttributeUsed byCallback signature
onActionbutton, toggleButton, checkBox, dropDown, gallery, comboBoxSee below
onChangeeditBox, comboBoxdef cb(control, text): ...
getPressedtoggleButton, checkBoxdef cb(control) -> bool

onAction signatures by control type:

# button, menu item:
def on_click(control):
    ...

# toggleButton, checkBox:
def on_toggle(control, pressed):   # pressed is True/False
    ...

# dropDown, gallery (when item selected):
def on_select(control, selectedId, selectedIndex):
    ...

Description attribute

AttributeTypeDescription
descriptionST_LongString (max 4096)Extended description shown in itemSize="large" menus
getDescriptioncallbackDynamic: def cb(control) -> str

Dynamic dropdown attributes

Used by dropDown, gallery, comboBox for dynamic item lists:

AttributeDescription
showItemImageboolean — show image next to each item
showItemLabelboolean — show label next to each item (dropDown/gallery)
sizeStringSample string used to calculate control width
getItemCountdef cb(control) -> int — number of items
getItemLabeldef cb(control, index) -> str
getItemImagedef cb(control, index) -> IPictureDisp
getItemIDdef cb(control, index) -> str
getItemScreentipdef cb(control, index) -> str
getItemSupertipdef cb(control, index) -> str
getSelectedItemIDdef cb(control) -> str (dropDown only)
getSelectedItemIndexdef cb(control) -> int (dropDown/gallery only)

Dynamic menu content

AttributeUsed byDescription
getContentdynamicMenuRequired. def cb(control) -> str — returns XML string
invalidateContentOnDropdynamicMenu, comboBox, galleryRe-fetch content every time the dropdown opens

String length limits

TypeMinMaxUsed for
ST_String11024label, screentip, supertip, keytip, tag, sizeString, image path
ST_LongString14096description, altText, helperText
ST_Keytip13keytip (no whitespace)
ST_StringLength11024maxLength on editBox

README.md

tile.json