I use the following code to open an Excel spreadsheet in my Access application:
After leaving Access my Excel file is still locked; what am I doing wrong?
Code:
Dim objXl As Object, objWkb As Object
Set objXl = New Excel.Application
MyExcelFile = <<path>>
Set objWkb = objXl.Workbooks.Open(MyExcelFile)
...
do things
...
Set objWkb = Nothing
objXl.Quit
Set objXl = Nothing
After leaving Access my Excel file is still locked; what am I doing wrong?