user1492136
user1492136

Reputation: 41

Application using Microsoft Office interop v.11 with Windows 7, Microsoft Office 2010

I inherited a custom application that was built using Visual Studio 2003 and .NET 2.0. It uses Microsoft Office PIA version 11 (for Office 2003), and it originally ran on Windows XP. The application relies on reading Excel, Word, and Powerpoint files, as well as Outlook for reading .PST files.

Now I am trying to get this application to work on a 64-bit, Windows 7 machine that has Office 2010. For the most part, the application works--it correctly reads the .PST files and uploads emails and attachments (along with correct metadata) to a Sharepoint. It's just that after I close the application and try to open Microsoft Office 2010 products (Word, Excel, Powerpoint, Outlook), these programs tend to crash. The error message would say "Microsoft __ has stopped working."

Looking at event viewer, the logs usually look like this:

Faulting application name: OUTLOOK.EXE, version: 14.0.6109.5005, time stamp: 0x4e79b881
Faulting module name: ntdll.dll, version: 6.1.7601.17514, time stamp: 0x4ce7ba58
Exception code: 0xc0000005
Fault offset: 0x0002e3fb
Faulting process id: 0x1b20
Faulting application start time: 0x01cd5631d6ed41d9
Faulting application path: C:\Program Files (x86)\Microsoft Office\Office14\OUTLOOK.EXE
Faulting module path: C:\WINDOWS\SysWOW64\ntdll.dll
Report Id: 2f11010e-c226-11e1-8b8d-9cb70de93ccf

After doing lots of browsing, I am guessing that it has to do with the application referencing PIA version 11 for Office 2003, and the version that I have on this computer is PIA version 14 for Office 2010. Also, I am 100% sure that it's this application that is causing Office 2010 applications to crash since it happens every time I run that legacy application. Restarting the computer fixes these crashes but I would rather not have to restart every time I run this application!

Short of actually updating the source code, is there anything I can do to fix this problem?

EDIT: I now have access to Visual Studio Express 2010 (C#) and I have source code files from using Reflector. So I guess I can start making code changes. I am still getting a lot of errors though, see my responses below...

Upvotes: 1

Views: 2590

Answers (3)

Larry
Larry

Reputation: 21

I had a similar problem using VB.Net 2012, Interop.Excel for MSO 14.0, and Windows 7, 64-bit. I was able to eliminate the problem by target .Net 4.0 instead of 4.5, and a 64-bit cpu.

Upvotes: 2

user1492136
user1492136

Reputation: 41

I tried to delete references to the old Microsoft Office PIA version 11 (for Office 2003), and add new references to the current PIA version 14 (for Office 2010). I also changed the target .NET to .NET 4 ... I am getting a lot of weird code errors now when building the package.

The main file would have

using System;
using Microsoft.Office.Interop.Excel;
using Microsoft.Office.Interop.Outlook;
using Microsoft.Office.Interop.PowerPoint;
using Microsoft.Office.Interop.Word;

But then when I tried to build the project, I would get all these errors that say

Microsoft.Office.Interop.Word.System does not contain a definition for 'IO'

The type name 'Drawing' does not exist in the type 'Microsoft.Office.Interop.Word.System'

Not sure why Visual Studio does not read the "System" namespace. It looks like the Word namespace is overriding the System namespace? When I remove the "using Microsoft.Office.Interop.Word" namespace, all the build errors disappear (except for the objects or methods that actually use Word, obviously)

Upvotes: 0

ManOnAMission
ManOnAMission

Reputation: 1043

Sounds like the legacy app is still holding on two shared components, thus causing the subsequent programs to crash.

There isn't much you can if you can't change the legacy app. Debugging it like the comment above suggests is a good way. But really you'd need to be able to change the app.

Could you get the source code? Or is that not part of the "delivery" of the vendor?

Upvotes: 3

Related Questions