Vista Office Interop not working

Does anyone know how to access MS Office libraries MS Office 2007.NET C # for working with Vista?

I have a .NET C # application that I have installed to work as a Windows service. This program will open a Word or Excel template, depending on the situation, and change its contents, and then save the document. All of this worked great when I did this on a computer running Windows Server 2003 or XP using Office 2007. When I moved everything to the Server 2008 window, everything stopped working. For example, in Excel, I get a COM exception telling me that the Excel file cannot be opened when the file is explicitly there, and I can open it just fine when I do it manually. The Windows service runs under the same user account with which I am logged in, and this account is the administrator.

Does anyone know what to do?

+3
source share
8 answers

Office . , xml (xlsx Office 2007 Excel xsd () .) API Excel .

+1

Vista Windows Server 2008 Session0. Vista Session0 .

, Session0 , explorer.exe. , , Office , .

Excel, Word .. , :

  • " " "LogOn" "" , . (, .)
    • 1, / , .
  • remoting/WCF, , interop, .
  • , , CreateProcessAsUser .
    • . , , , , 2 , . ( P/Invoke)
  • , SDK OpenXML - SpreadsheetGear.
+2

Microsoft, , Office.

+1

, ? GAC bin , .

0

, UAC. , () - . , UAC, . , Office ( ) .

UAC , . , , , .

0

, ? Office , , .

0

- Office. x86, , x64, COM, Office. x86, .

, x86 build visual studio.

It is all assumed that your application is being developed / launched in the x64 environment that is located.

0
source

Source: https://habr.com/ru/post/1698768/


All Articles