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

前端 未结 3 883
自闭症患者
自闭症患者 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:27

    It depends on what you want. If Excel is already open, using dispatch will create a new tab in the open Excel instance. If Excel is already open, using dispatchEx will open a new instance of Excel.

提交回复
热议问题