reading excel

V

vinay

i am trying to read excel using this code. also tried with ApplicationClass.

Microsoft.Office.Interop.Excel.Application app = new
Microsoft.Office.Interop.Excel.Application();
Workbook book = null;
Worksheet sheet = null;
Range range = null;
book = app.Workbooks.Open(openFile.FileName, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value);
sheet = (Worksheet)book.Worksheets[1];

i am getting error at app.workbooks.Open ----- Exception from HRESULT:
0x800A03EC

unable to find the solution

Thanks for any help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top