I'm using python 2.7.11 on a windows 10 machine where I'm updating a file using VBA contained in the Update_table.xls worksheet. I'm using the below code but I am finding that the Excel worksheet sometimes remains open in the task manager once the py script has ran.
import win32com.client
xl=win32com.client.Dispatch("Excel.Application")
xl.Workbooks.Open(Filename="C:\Projects\Update_table.xlsb",ReadOnly=1)
xl.Application.Run("Update2")
xl = 0
As I am running multiple scripts at once is there a way to ensure the workbook is closed? & not close the whole excel application.