Connect to existing kernel
When I open a workbook and run macro (with optimize connection=True) it creates a pythonw kernel (on Windows 7 and Office 2010).
If I close the book and reopen it and run the macro, it creates another process, instead of connecting to existing one.
If I keep closing and opening the workbook it creates several new pythonw kernels.
If I connect to existing kernel I obtain two results:
1) avoid memory and resource consumption
2) use resident objects from previous calculations.
The behaviour you’re seeing is not the intended one and part of the reason why this feature is still labeled “experimental”. If you create your Workbook.caller() reference within a function in the python module, it should however correctly exit the pythonw process when leaving Excel. A full/proper integration of these two librararies (xlwings/ExcelPython) is one of the next planned steps though.