I am creating an application in which user has to upload the excel file, using below code i am validating the file whether it is valid or corrupted. For this i am using mircrosoft.Office.interop.excel dll. In below code, I am getting exception " Exception from HRESULT: 0x800A03EC"
static void openfile()
{
try
{
string mySheet = @"E:\7.xlsx";
var excelApp = new Excel.Application();
excelApp.Visible = true;
Excel.Workbooks books = excelApp.Workbooks;
Excel.Workbook sheet = books.Open(mySheet);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
static void Main(string[] args)
{
openfile();
}
What is the issue? Could you please help on this issue?