0

I'm facing a problem regarding Word interop library. I have an installation of a C# .NET 3.5 Web Service that opens an docx document. The same code unchanged was working until something changed (I don't have any idea what changed).
Now the Web Service stops (no log, no error message) when tries to create a Word.Application object.

var wordApp = new Word.Application();  

I have tried also Word.ApplicationClass(), same result. I'm using the version 14 - Office 2010 which is installed on the Windows 2003 Web Server. I have also installed the PIA redistributable for Office 2010. I have removed the and add again the Word COM reference, rebuild etc.

Do you have any idea how can I find what is missing? I've done lot of googling so I'm really sorry if this question is duplicated.

SWE
  • 485
  • 1
  • 4
  • 19
  • Kind of obvious but have you restarted the server? Also you need to add the `Microsoft.Office.Interop.Word` reference from the .Net tab, not the COM one. – JMK Apr 22 '13 at 21:20
  • 2 times.. Nothing changed man. I have also import lib from .NET tab. – SWE Apr 22 '13 at 21:29
  • If I am understanding your question right, you need to take a look at this: http://stackoverflow.com/questions/9438577/using-microsoft-office-interop-word-in-asp-net – Pete Garafano Apr 22 '13 at 21:41
  • http://support.microsoft.com/kb/257757 Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment. – ta.speot.is Apr 22 '13 at 21:48

1 Answers1

1

Finally,

Word crashed because of its license expiration!

Thank you for your input!

SWE
  • 485
  • 1
  • 4
  • 19
  • Don't forget the licenses on the client-side as well http://support.microsoft.com/kb/257757 Besides the technical problems, you must also consider licensing issues. Current licensing guidelines prevent Office applications from being used on a server to service client requests, unless those clients themselves have licensed copies of Office. Using server-side Automation to provide Office functionality to unlicensed workstations is not covered by the End User License Agreement (EULA). – ta.speot.is Apr 24 '13 at 07:09