For using Excel as the front end to your Python code PyXLL is a better choice. It's not free, but it's more robust, a lot faster, and has many more features than xlwings. Check out https://support.pyxll.com/hc/en-gb/articles/360042910613-What-is-the-difference-between-PyXLL-and-xlwings- for some of the differences.