How can I close excel aplication completely in word vba?
My code:
Dim ExcelApp As Object, ExcelBook As Object
Set ExcelApp = CreateObject("excel.Application")
Set ExcelBook = ExcelApp.Workbooks.Open(ActiveDocument.Path & "\data.xls")
'ExcelApp.Visible = True/False
ExcelApp.DisplayAlerts = False
'something with ExcelBook, just editing cells
ExcelBook.Close savechanges:=True
Excel.Application.Quit
Set ExcelBook = Nothing
Set ExcelApp = Nothing
When I open taskmanager there is still proces EXCEL running. Problem is, that I need to run macro multiple times and than my data.xls - excel file can be open read only.