Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello,
I am Performing Reading operation on Excel Workbook (Xlsx)
I do not have Msoffice installed on my Machine,
While Creating Object of ExcelWorkBook it throws error Like

Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

So My Question is that to Perform Programming on Excel is there a need to install MsOffice excel first ?
Posted
Comments
aayu 16-Sep-10 3:29am    
yes first you have to install msOffice before that he will not understand what he have to do.

Yes, you have to install MSOffice.
You can also use OLEDB Provider for this.

This is code for u -
C#
string connectionString = String.Format(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1;""", fileName);
string query = String.Format("select * from [{0}$]", "Sheet1");
OleDbDataAdapter dataAdapter = new OleDbDataAdapter(query, connectionString);
DataSet ds = new DataSet();
dataAdapter.Fill(ds);
return ds;
 
Share this answer
 
v3
MS Office does not just give you Excel, Word etc, but also the framework that allows data manipulation, import export, VBA etc.

It is necessary for it to be installed in order to have the functionality available for iis etc.
 
Share this answer
 
Comments
Monjurul Habib 28-Apr-11 18:45pm    
nice recommendation.my 5.
Yes Microsoft Office needs to be installed in your machine. As for C# programming we needed to add a reference to excel and this visual studio can get only when components of Microsoft office is registered. While installing office all the components gets registered and we get reference of that registered component in our program.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900