Click here to Skip to main content
15,936,903 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

In windows applications I am using C#.net.

My requirement is to open an excel file that already exists in my drive.
I am using this sample code, but my problem is it was showing the error one time and it was working perfectly the next.

Please help me, where am I going wrong?

Here's my sample code;

Excel.Application xlApp;
Excel.Workbook xlWorkBook;
object misValue = System.Reflection.Missing.Value;
xlApp = new Excel.Application();
xlApp.Visible = true;
xlWorkBook = xlApp.Workbooks.Open("C:\\Documents and Settings\\Owner\\Desktop\\intetrfacetest.xlsx", misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue);



error is :
Creating an instance of the COM component with CLSID {00024500-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 80010001.
Posted
Updated 20-Feb-11 22:19pm
v3
Comments
Prerak Patel 21-Feb-11 3:13am    
what error it gives?
Sunasara Imdadhusen 21-Feb-11 3:14am    
What error it is showing??
[no name] 21-Feb-11 3:37am    
Creating an instance of the COM component with CLSID {00024500-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 80010001.
CS2011 21-Feb-11 4:25am    
Can you Provide the stack trace....mean while you can also check dis

http://blogs.infragistics.com/forums/p/16197/90453.aspx

1 solution

I think straight off you need to edit the address being used...

<br />
C:\\Documents and Settings\\Owner\\Desktop\\intetrfacetest.xlsx<br />


It should be obvious what is wrong there.
 
Share this answer
 
v2
Comments
P Nagarjuna 29-Aug-11 1:00am    
how to open Excel file(text files pdf files ,microsoft files) in i frame control or other control and reading writing the excel file to save in data base.

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