View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
via135
 
Posts: n/a
Default Excel crashes while trying to save, add or delete rows


Can't help with the info provided, but one thing to try is to carefully
ensure you release every Excel object you instantiated as described in
the following kb article:

http://support.microsoft.com/default...;EN-US;q317109

If you do this right, you should not need to call GC.Collect to get
Excel to quit.

But it's not easy to ensure it's right for all code paths including
exceptions, and for all versions of the code including ones which will
be modified by a maintenance programmer a few months down the road...

One way to get round the problem of unreleased references is to write
all the Excel interop code in a VB6 ActiveX DLL, never exposing any
Excel objects to managed code. Your managed code than instantiates a
single instance of the VB6 ActiveX object and uses it to interop with
Excel. When you release the instance of your VB6 ActiveX object, it
uses classic VB6 reference counting to release all Excel references.


-via135




scaramushe Wrote:
Hi,
I am working on Excel 2003, Windows XP. The problem is that almost
every time i try to add or delete rows or columns or to move cells
Excel crashes. The same happens almost every time i'm attempting to
save the file, either before or after it saves, while calculating
cells. it happens even more often when i am trying to use "save as".
The file is 10 MB, without much formatting but with lots of vlookups
and cimilar finctions.
I tried to open it on different computers but the result was the same.
Please help me to repair the file.
Thanks,



--
via135
------------------------------------------------------------------------
via135's Profile: http://www.excelforum.com/member.php...o&userid=26725
View this thread: http://www.excelforum.com/showthread...hreadid=519142