3
import win32com
import win32com.client as win32

xl = win32.gencache.EnsureDisplatch('Excel.Application')

This fires up Excel, but for whatever reason none of the plugins load.

If Excel was already loaded, the plugins will stay loaded and be accessible.

Please advise.

Context: I'm scraping data from a worksheet that makes calls using a proprietary plugin. If the plugin doesn't load, all the cells I need to scrape just throw errors.

Jason Goldstein
  • 1,117
  • 2
  • 11
  • 20

2 Answers2

0

xl = win32.gencache.EnsureDisplatch('Excel.Application')

typos here.

xl = win32.gencache.EnsureDispatch('Excel.Application')

YoYue
  • 41
  • 2
  • 7
0

Perhaps you can add the code to access your plugin in a macro and then automate the macro from Python.

xl.Run("Book1.xls!Macro1")
Scott
  • 136
  • 4