Thread: reading excel
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Vinay Vinay is offline
external usenet poster
 
Posts: 8
Default reading excel

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.