I have the SQL Spreads add-on for work unrelated to this code.
When I attempt to run my xlwings python script, it always crashes when attempting to open an excel workbook:
wb_output = xw.Book(output_file_path, update_links=False)
with this error code:
Exception has occurred: com_error
(-2146959355, 'Server execution failed', None, None)
When this occurs, it also disables the SQL Spreads add-in. When I run the code a second time, it functions correctly and is able to work without interruption. However, I have to re-enable my SQL Spreads extension every time after running the script.
I have been unable to avoid the first crash and disabling of SQL Spreads. SQL Spreads requires a Microsoft account login when opened, so my suspicion is that xlwings gets timed out when SQL Spreads requests the login info.
How can I make xlwings not disable my other add-in, and not crash the first time I run the python script?



After working on this some more, I have found a work around.
This prevents the login popup from disrupting the xlwings code, as it has already been satisfied. I have noticed this workaround is not perfect, and sometimes results in SQL Spreads being disabled, but it is successful most of the time.