progId not found. Excel.Application

Jul 24, 2013 at 2:59 PM
Hey,

I want to open a .csv file with Excel, using C#.

I copied the ExcelApi.dll, NetOffice.dll, OfficeApi.dll and VBIDEApi.dll into the debug folder of my Projekt and added the references to my Project. (Also set embed Interop Types to "false")

The imports i added are:
using NetOffice;
using Excel = NetOffice.ExcelApi;
using NetOffice.ExcelApi.Enums;
and the code i try to runs is:
String filename=@"..\..\..\..\Results\result.csv";
Excel.Application excelApplication = new Excel.Application();
excelApplication.DisplayAlerts = false;
Excel.Workbook workbook;
workbook = excelApplication.Workbooks.Open(
filename, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
The Programm i'm using is Visual Studio 2012 Ultimate, and if i try to run the code i get this message:

progId not found. Excel.Application
in the code line:
Excel.Application excelApplication = new Excel.Application();
The Project is set to .Net Framework 4.5 and i used the dll's from the Net4.5/assemblies/AnyCpu folder.

I have the Microsoft Office Home and Student 2010 version installed at my Computer.

Does anybody know how to fix the problem?

Thanks in advance
Stephan
Coordinator
Jul 24, 2013 at 9:47 PM
hmm not sure the student version is accessible trough code or the progid is different. i dont have the student version to clearify the situation. please help me and perform a search in the registry for '00024500-0000-0000-C000-000000000046'
you find something like that HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID{00024500-0000-0000-C000-000000000046}
you will see a sub hkey called 'ProgID' and VersionIndependentProgID. please copy the default entry value to see whats the problem.

thx*
Sebastian
Jul 24, 2013 at 10:09 PM
Edited Jul 26, 2013 at 3:33 AM
Hey, thanks for the reply.
I started the registry with "regedit" and searched for '00024500-0000-0000-C000-000000000046' .
The search finished without results.
By the way, i got a german version of windows & Office(but i think that shouldn't make a difference).

UPDATE:
The Error is gone now, I reinstalled Office. The first time i just upgraded the test version with a license key. So i had the click to run version. After the reinstallation the above mentioned key was in the registry.

Stephan