Using pywin32, what is the difference between Dispatch and DispatchEx?

前端 未结 3 925
自闭症患者
自闭症患者 2021-02-06 05:12

When opening e.g. a spreadsheet with pywin32, I found two options to do so:

excel1 = win32com.client.DispatchEx(\'Excel.Application\')
wb = excel1.Workbooks.Open         


        
3条回答
  •  甜味超标
    2021-02-06 05:49

    If you're using COM to automate, say, Excel there will come a time when you want .Dispatch to fire up a new instance of the application, not to interfere with the one already running on the desktop.

    Use DispatchEx instead of Dispatch

提交回复
热议问题