J
John Winterbottom
(On WinXP Pro SP2 / Access 2003 / Excel 2003)
The following code, when run from Access, leaves a copy of Excel.exe hanging
around in memory.
'***********************************************
Sub testXL()
Dim objXL As Object
Dim wkbXL As Object
Dim strFileName As String
On Error GoTo errHandler
strFileName = "C:\Test.xls"
Set objXL = CreateObject("Excel.Application")
Set wkbXL = objXL.Workbooks.Open(strFileName)
exitHere:
On Error Resume Next
wkbXL.saved = True
wkbXL.Close
' also tried this
' wkbXL.Close savechanges:=False
Set wkbXL = Nothing
objXL.Quit
Set objXL = Nothing
On Error GoTo 0
Exit Sub
errHandler:
MsgBox (Err.Description)
Resume exitHere
End Sub
'***********************************************
Code works fine against Excel 2002 and 2000. Is this a known issue with
Excel 2003? I've tried many variants including explicitly referencing Excel
library, early binding, explicit Save of workbook. None of them have worked.
I tried setting Application.Visible=True to see if there was any dialog open
that was waiting for input but nothing showed up.
Any help would be appreciated.
The following code, when run from Access, leaves a copy of Excel.exe hanging
around in memory.
'***********************************************
Sub testXL()
Dim objXL As Object
Dim wkbXL As Object
Dim strFileName As String
On Error GoTo errHandler
strFileName = "C:\Test.xls"
Set objXL = CreateObject("Excel.Application")
Set wkbXL = objXL.Workbooks.Open(strFileName)
exitHere:
On Error Resume Next
wkbXL.saved = True
wkbXL.Close
' also tried this
' wkbXL.Close savechanges:=False
Set wkbXL = Nothing
objXL.Quit
Set objXL = Nothing
On Error GoTo 0
Exit Sub
errHandler:
MsgBox (Err.Description)
Resume exitHere
End Sub
'***********************************************
Code works fine against Excel 2002 and 2000. Is this a known issue with
Excel 2003? I've tried many variants including explicitly referencing Excel
library, early binding, explicit Save of workbook. None of them have worked.
I tried setting Application.Visible=True to see if there was any dialog open
that was waiting for input but nothing showed up.
Any help would be appreciated.