I made a very simple c# program for testing the access to some file path for different users. For everyone the program works fine, but for one user the program return the exception
System.io.filenotfoundexception: retrieving the COM class factory component with CLSID{} failed due to the following error: 80070002
and this happen when he try to create a Microsoft.Office.Interop.Excel.Application object.
using System;
using System.Runtime.InteropServices;
using Excel = Microsoft.Office.Interop.Excel;
using System.Windows.Forms;
using System.Diagnostics;
namespace TestExcelBianchi
{
class Program
{
static void Main(string[] args)
{
...
Excel.Application excel = new Excel.Application();
Excel.Workbook wb=null;
....
}
}
}
This issue started to happen after running the Office repair on the user pc, probably is missing the office PIA. Do I need to reinstall office on the user machine or is there a way to avoid it?