Hi,
I'm trying to access an excel sheet in my machine thru C# via ASP.NET. I keep getting the above error message (see subject). I have added the following references:
Microsoft Excel 11.0 Object Library
Microsoft Office 11.0 Object Library
Here's the code I have:
private void Button1_Click(object sender, System.EventArgs e)
{
//Excel.Application objExcel = new Excel.Application();
Excel.Application ObjExcel = null;
ObjExcel = new Excel.Application();
if (ObjExcel == null)
{
MessageBox.Show("Error opening the Excel Application");
Application.Exit();
}
//Make the Application Visible
ObjExcel.Visible = true;
}
The error I previously mentioned points to NEW (bold). Any suggestions how I can successfully create the excel instance.
Thank you!
I'm trying to access an excel sheet in my machine thru C# via ASP.NET. I keep getting the above error message (see subject). I have added the following references:
Microsoft Excel 11.0 Object Library
Microsoft Office 11.0 Object Library
Here's the code I have:
private void Button1_Click(object sender, System.EventArgs e)
{
//Excel.Application objExcel = new Excel.Application();
Excel.Application ObjExcel = null;
ObjExcel = new Excel.Application();
if (ObjExcel == null)
{
MessageBox.Show("Error opening the Excel Application");
Application.Exit();
}
//Make the Application Visible
ObjExcel.Visible = true;
}
The error I previously mentioned points to NEW (bold). Any suggestions how I can successfully create the excel instance.
Thank you!