xlSlim 2.0.4 improves support for dictionaries, classes, enums and more!

Many changes have been made in xlSlim 2.0.4

Dictionaries can be created from a two-column Excel range, the first column is used for the keys and the second column is used for the values. In practice this means that a function expecting a Python dictionary can now be passed a two-column Excel range. The range will be transformed into a dictionary by xlSlim before passing the dictionary to the Python function.

Classes can be created directly in Excel. Every class __init__ method is registered as an Excel function (the Python class name is used for the Excel function name). This is very useful when structuring your Python code and using data classes. Python classes can be created and then passed to other functions.

Python enums are now supported. Enums can be both returned from functions and passed into functions. When passing an enum into a function, simply pass the enum's string value from Excel, xlSlim will then lookup the matching enum object and pass this to the Python function.

The ViewPyObject() utility function has been enhanced. Datetimes are displayed correctly and nested structures are supported.

Two new utility methods, GetAttr() and GetItem(), behave just like their Python namesakes, allowing easy access to class attributes and dictionary values.

I will update the documentation in due course, in the meantime please enjoy the new functionality!

Back to blog

Leave a comment