The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))
my code;
private void GetExcel(string fileName)
{
string str = string.Empty;
Application application = null;
Workbook workbook = null;
Worksheet xlWs = null;
Dictionary<string,> dictionarySingleValue = new Dictionary<string,>();
try
{
application = (Application)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("00024500-0000-0000-C000-000000000046")));
if (application == null)
{
Console.WriteLine("EXCEL could not be started. Check that your office installation and project references are correct.");
}
else
{
application.Visible = false;
workbook = application.Workbooks.Open(fileName, 0, false, 5, "", "", true, XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
string str2 = System.IO.Path.GetFileName(this.fileuploader.FileName);
string fileNameWithoutExtension = System.IO.Path.GetFileNameWithoutExtension(this.fileuploader.FileName);
for (int i = 1; i <= workbook.Worksheets.Count; i++)
{
if (!((Worksheet)workbook.Worksheets[i]).Name.StartsWith("Sheet"))
{
string str5;