Error in Office 365 (Web) when using System.Diagnostics.Process.Start(@'c:\document.xls') by C#

Luis Herrera 1 Reputation point
2022-01-07T13:48:05.64+00:00

Good evening!
I'm a self-employed C# desktop developer (Visual Studio 2008 Pro and Dot.Net 3.5). I've always used the System.Diagnostics.Process.Start(@'c:\document.xls') resource; to open any application by passing a file that is either on the user's computer or on your company's internal server. It always worked perfectly until I came across a client using Office 365 (Web). When executing this command, the error message appears: 'Microsoft Office was unable to verify the license for this product'.

All Office programs work perfectly if I click on any file .docx, .xlsx, .xls etc... it runs its editor and opens the file, the error only occurs when there is this call by my C# program. As Office is not installed, I believe this is the problem, but I don't know what distinction Windows makes now between the two calls (by clicking directly on the.doc file or passing the same through Process.Start via C#).

Note 1: My wife has Office 365 (current license), but it is installed on her computer and can also access it via web browser and everything works perfectly, only on the computer without it installed, the error occurs,

Note 2: My C# application is installed in compatibility mode on Win 64 computers, as it is made on 32bits platform. Everything works perfectly from Windows XP to Win 10.

How can I solve this problem?

Thanks

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,362 questions
{count} votes