CLR crash while using Word interop

  • Thread starter Richard G. Bayer
  • Start date
R

Richard G. Bayer

Hi,

this happens only on some machines, but I have not yet figured out what
they have in common:

Trying to generate a .doc report using tools from
Microsoft.Office.Interop.Word the application crashes, even log4Net does
not close its log.

The crash message says a lot of things, the only thing I found reasonable
is: exception code: 0xe053534f

I googled the code and only found out it has to do with .NET and COM
cooperation, should be something done wrong by the Visual Studio 2005
compilers. The solution to this should be a hotfix - the replacement of a
library or so. The problem should not be present in VS 2008. And I've got
VS 2008. So the things I found out seem to be of no use here.

Here is what I am doing in the app:
1 start Word
2 open a document (which serves as template, will SaveAs something else in
the end)
3 find a keyword in the document and replace it with a value
3.1 run the Find.Excecute(...), that returns a Range object
3.2 set the Range.Text to the value I want in place of the keyword

etc. etc.

8 saveAs the documetn
9 close Word


At point 3 the app crashes. Although I am logging on some points during
point 3, I am not sure which exact line causes the crash. For one I don't
trust log4net, because it has no time to finish - the log is not properly
closed due to the hard crash, maybe the logger did not log other stuff.
And then the crashes only appears on customer's machines. The customer
claims that it appears on every 5th machine. On these machines it crashes
always and at the same point. The machines are of the same hardawe (lenovo
notebooks) and installed by the same administrator, so I guess there is no
difference in installation of Office on those crashing machines. They have
Windows XP and Office 2003 installed.

What I tried:
- Update one of the notebooks to XP SP3: no effect (thought library fixes
could do)
- Upgrade a machine to .NET 3.0 and compile the app for 3.0: No effect
- Switch to newer interop libs - used Office 11 libs, tried Office 12
libs: No effect

I can't borrow one of the machines and try to debug on them directly. I am
not experienced in exploring crash dumps.

So, has anyone an idea how to proceed?
Thanx a lot in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top