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

Configuration Variables¶

PyXLL creates some configuration substitution variables that can be used in any config values.

Variable substitution in the config file follows the same format as Python’s configparser module, which is %(name)s, where name is the variable name.

For example, including today’s date in the log file name would be specified as:

[LOG]
file = pyxll-log-%(date)s.txt

The following sustitution variables are available:

Variable Name

Format

Description

PyXLL Version

pid

%(pid)s

Process id

All

date

%(date)s

Current date in YYYYMMDD format

All

time

%(time)s

Current time in HHMMSS format

>= 5.6

xl_version [1]

%(xl_version)s

Excel version

All

py_version

%(py_version)s

Python version

>= 5.2

pyxll_version

%(pyxll_version)s

PyXLL version

>= 5.2

xll_path

%(xll_path)s

Full path of the pyxll.xll add-in

>= 5.6

xll_dir

%(xll_dir)s

Directory containing the pyxll.xll add-in

>= 5.6

cfg_path

%(cfg_path)s

Full path of the config file being processed

>= 5.6

cfg_dir

%(cfg_dir)s

Directory containing the config file being processed

>= 5.6

basecfg_path [2]

%(basecfg_path)s

Full path of the base config file

>= 5.6

basecfg_dir [2]

%(basecfg_dir)s

Directory containing the base config file

>= 5.6

In addition to these standard substition variables, environment variables can also be used as substitution variables in the config. See Environment Variables for more details about using environment variables in the config file.

Footnotes

[1]

xlversion was renamed to xl_version in PyXLL 5.2 but both forms will continue to work.

[2] (1,2)

The base config is the first config file loaded by the add-in. This can be different from the config file being processed if the base config specifies additional config files using the external_config option.

« Warnings
Environment Variables »
  • Home
  • Product
  • Features
  • Documentation
  • Download
  • Pricing
  • Support
  • Documentation
  • Videos
  • FAQ
  • Learn Python
  • Contact Us
  • About
  • About Us
  • Legal
  • Blog
© Copyright PyXLL Ltd