I have the following python code that opens my excel file and closes it; however, the Excel app remains open. I have other python script running in the background so I only want to close the application it opened when it opened the file (not all running Excel applications).
xlapp = win32com.client.DispatchEx("Excel.Application")
xlapp.DisplayAlerts = False
xlapp.Visible = True
wb = xlapp.Workbooks.Open(file_path)
if refresh1 == True:
wb.RefreshAll()
xlapp.CalculateUntilAsyncQueriesDone()
wb.Save
wb.SaveAs(yestmoPath, FileFormat="51")
wb.close
I tried xlapp.quit at the end and receive this message: <bound method quit of >