Can't close Excel completely using win32com on Python
What worked for me was making sure to de-reference any variables that you assigned along the way like so:
import win32com.client as win32fileDirectory = 'Hello World.xlsx'#excelFile = win32.Dispatch('Excel.Application')excelFile = win32.gencache.EnsureDispatch('Excel.Application')excelFile.Visible = TrueexcelFile.DisplayAlerts = Truewb = excelFile.Workbooks.Open(fileDirectory)ws = wb.Sheets("Sell")ws.Range("D1").Value = "Hello World!"ws = Nonewb.Close(False)wb = NoneexcelFile.Quit()excelFile = None
It worked with either Dispatch format.