R
Rich Wallace
Hi all,
I have a VB app that runs and manages individual XLS files within a single
COM object. Upon processing the final fie, I attempt to close out the EXCEL
object and release it using
System.Runtime.InteropServices.Marshal.ReleaseComObject.
I have a Try...Catch in my routine as seen below and when I receive the
error, my Catch is never called so my app sees the release as successful,
but when I look in Task Manager, the EXCEL.EXE instance is still running and
a Windows Application error pops up...see below code snippet
Private Sub ObjectRelease(ByVal o As Object)
Try
System.Runtime.InteropServices.Marshal.ReleaseComObject(o)
Catch
MsgBox(Err.Description)
Finally
o = Nothing
End Try
End Sub
Error:
Microsoft Excel: EXCEL.EXE - Application Error
The instruction as "0x77ab193d" referenced memory at "0x0207da34". The
memory could not be "read".
Memory should not be an issue on the server I am running the app on. BTW, I
do clean up any/all references to any Sheets, Workbooks/Workbook objects
prior to calling the ablove code:
'Release the Excel objects
oBook.Save()
ObjectRelease(oSheet)
oBook.Close(False)
ObjectRelease(oBook)
ObjectRelease(oBooks)
oExcel.Quit()
Any ideas??
TIA
-Rich
I have a VB app that runs and manages individual XLS files within a single
COM object. Upon processing the final fie, I attempt to close out the EXCEL
object and release it using
System.Runtime.InteropServices.Marshal.ReleaseComObject.
I have a Try...Catch in my routine as seen below and when I receive the
error, my Catch is never called so my app sees the release as successful,
but when I look in Task Manager, the EXCEL.EXE instance is still running and
a Windows Application error pops up...see below code snippet
Private Sub ObjectRelease(ByVal o As Object)
Try
System.Runtime.InteropServices.Marshal.ReleaseComObject(o)
Catch
MsgBox(Err.Description)
Finally
o = Nothing
End Try
End Sub
Error:
Microsoft Excel: EXCEL.EXE - Application Error
The instruction as "0x77ab193d" referenced memory at "0x0207da34". The
memory could not be "read".
Memory should not be an issue on the server I am running the app on. BTW, I
do clean up any/all references to any Sheets, Workbooks/Workbook objects
prior to calling the ablove code:
'Release the Excel objects
oBook.Save()
ObjectRelease(oSheet)
oBook.Close(False)
ObjectRelease(oBook)
ObjectRelease(oBooks)
oExcel.Quit()
Any ideas??
TIA
-Rich