I've got an issue where my late binding between Access 2010 VBA and Excel 2010 is leaving a Excel.exe process behind
I'm creating the objects via:
In the middle I'm only ever reading from the multiple sheet workbook.
And when closing/exiting the sub I've got:
I do pass wsSheet to some other functions, and that is always done via ByRef wsSheet as Object.
I can't see what's keeping Excel open :banghead: and having it open screws up the app next time the user wants to run this functionality again.
Office 2010 seems a lot worse in this respect than 97 ever was
I'm creating the objects via:
Code:
Dim wbExcel As Object, wsSheet As Object
'Open the workbook, pick the worksheet and open it
On Error Resume Next
Set wbExcel = GetObject(, "Excel.Application")
If Err.Number <> 0 Then
'Could not get instance, so create a new one
Err.Clear
On Error GoTo Error_Handler
Set wbExcel = CreateObject("Excel.Application")
Else
On Error GoTo Error_Handler
End If
wbExcel.WorkBooks.Open (sExcelFile)
Set wsSheet = wbExcel.Worksheets.Item("Score Sheet")
In the middle I'm only ever reading from the multiple sheet workbook.
And when closing/exiting the sub I've got:
Code:
On Error Resume Next
wsSheet.Close
Set wsSheet = Nothing
wbExcel.Application.Quit
Set wbExcel = Nothing
Set rs = Nothing
Exit Function
I do pass wsSheet to some other functions, and that is always done via ByRef wsSheet as Object.
I can't see what's keeping Excel open :banghead: and having it open screws up the app next time the user wants to run this functionality again.
Office 2010 seems a lot worse in this respect than 97 ever was