I've seen from various questions on here that if an instance of Excel is opened from Python using:
xl = win32com.client.gencache.EnsureDispatch('Excel.Application')
xl.Visible = True
wb = xl.Workbooks.Open('Test.xlsx')
Then it does not load the default add-ins. I've tried forcing my add-in to load by instead running:
xl = win32com.client.gencache.EnsureDispatch('Excel.Application')
xl.Visible = True
addin = xl.Workbooks.Open('C:/path/addIn.xll')
wb = xl.Workbooks.Open('Test.xlsx')
However, when I do this an instance of Excel opens and I get a security message asking me to verify I want to open this add-in. If I click "Enable this add-in for this session only" Excel immediately closes and does not open my desired xlsx file.
Does anyone have any ideas how to force the add-in to load and then to allow me to open my file?
Thanks very much for your help!