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

I am working with Selenium and C# for Automation.
one of our requirement that we have to open an excel sheet and some calculate some values like filters, count, Ave etc.

I have used below code, but I got an error.

Note: I am using Microsot Excel 2007.

Thanks,


What I have tried:

Excel.Application x1Appl = new Excel.Application();
Excel.Workbook x1WorkBook = x1Appl.Workbooks.Open(@"C:\Users\User1\Desktop\Test.xlsx");

Nuget Package "Microsoft.Office.Interop.Excel".

error was: "System.Runtime.InteropServices.COMException: 'Exception from HRESULT: 0x800A03EC'"
Posted
Updated 20-Sep-18 5:31am

1 solution

You need Excel installed on the machine and working. Interop.Excel is just a c# interface that can be used to automate Excel, but Excel has to be on the machine in order for it to be automated.
 
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