This error indicates a problem with the cached wrapper classes used by the pywin32 (win32com) package and may cause problems when trying to call the Excel COM API via the win32com package.
TL;DR; Set the following in your pyxll.cfg file
[PYXLL]
win32com_gen_path = ./gen_py
win32com_delete_gen_path = 1This is a problem with the pywin32/win32com package. Occasionally when creating it's wrapper classes it will create a corrupt or invalid package that can't be imported. The corrupted files need to be deleted, and then they are recreated the next time they're needed, fixing the problem.
PyXLL has some settings to help with this problem, and from PyXLL 5.12 it includes a workaround to reduce the chances of win32com creating a corrupted wrapper package. A fix for the issue has been accepted into the pywin32 project, but a the time of writing that is not yet in the current pywin32 release (311).
Please see https://www.pyxll.com/docs/userguide/config/pyxll.html#win32com-settings for details of the settings that will help manage this issue with corrupted wrapper files.
We suggest setting "win32com_gen_path" to somewhere other than win32com's default folder initially. That setting can be a relative path to the pyxll.cfg file, ensuring that it's only used by PyXLL.
If you still get these errors happening after setting "win32com_gen_path" you can also use the "win32com_delete_gen_path" setting to delete the cache folder each time Excel starts, causing the wrapper classes to be regenerated each time.