Author
Topic: Miscellaneous question (Read 626 times)

I use PyCharm as IDE which does real-time code inspection and referencing. It gets stuck on the pyxll import statements considering the package not installed. Should I point it to pyxll.py?

Several of my functions make database queries. I'm wondering what is the persistence of variables between function calls, excel instances, etc... If I declare a global variable in an imported module, is it available and persisted across all function calls of all excel instances or all function calls of a single workbook? Is there a way to call a function on excel exit (to clean-up db connections)?

I get this warning in the PyXll log: "WARNING : InitCommonControlsEx failed with code 0" but no ill side-effect. Is there something I should do about it?

yes, that's exactly what the pyxll.py stubs file is for. You can also use it for unit tests or anywhere else you need to run your code outside of Excel.

It's a single Python interpreter, so all globals are persisted across all function calls in the same Excel instance (regardless of how many workbooks you have open in the same Excel instance). If you run multiple Excel processes they are independent.

No that's nothing to worry about. It just means that windows call has already been called elsewhere (i.e. by Excel when it starts up). I should remove that warning...