St.cache_resource() has a problem when it comes to caching applications

Hi Everyone! I am trying to create an instance of Excel and cache it so that when I need to open Excel files, I don’t have to wait for long time for Excel to launch. The problem is that it is very unstable. Sometimes it runs with no problem, but sometimes I get the error that says: com_error: (-2147220995, ‘Object is not connected to server’, None, None). Here is my Code:

import xlwings as xw

def dispatch_excel(self):
excel = xw.App(visible=False)
return excel