2

I am opening Excel 2016 from Python using the PyWin32 package using the following code

import win32com.client as win32
from win32com.client import Dispatch

def openWorkbook(filePath):
    excelObj = win32.gencache.EnsureDispatch("Excel.Application")
    excelObj.DisplayAlerts = False
    excelObj.Visible = True
    wbkObj = excelObj.Workbooks.Open(Filename=filePath)
    return(excelObj, wbkObj)

When I open workbooks in this way, a number of the add-ins which I rely upon are not initialized, though they do initialize when I open Excel in the typical fashion.

While I understand that I can initialize them manually via their filepaths, I would much prefer to open Excel in such a way that all of the add-ins which typically initialize are included.

Thank you.

CJ B
  • 139
  • 10
  • 1
    Your out of luck I'm afraid, this is by design - to improve load time and to remove the possibility of addin errors/dialogs blocking the instantiation. Depending on the type of addin you may be able to avoid the need for physical paths e.g. http://stackoverflow.com/questions/213375/loading-addins-when-excel-is-instantiated-programmatically – Alex K. Apr 07 '17 at 09:45

0 Answers0