Hi..
As i want Print the Particular Excel Sheet from excel file.i wrote some coding to print Excel sheet but i got some errors while print the document.
Error Details
exception from hresult 0x800a03ec
My Code:
Excel.Application excelApp = new Excel.Application();
string dtime;
dtime = day + "-" + month + "-" + year;
Excel.Workbook wb = excelApp.Workbooks.Open("D:\\Saved Sheets\\" + lblusername + "\\" + file_name + "-" + dtime + ".xlsx", Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
Excel.Worksheet ws = (Excel.Worksheet)wb.Worksheets[1];
ws.PrintOutEx(Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
GC.Collect();
GC.WaitForPendingFinalizers();
Marshal.FinalReleaseComObject(ws);
wb.Close(false, Type.Missing, Type.Missing);
Marshal.FinalReleaseComObject(wb);
excelApp.Quit();
Marshal.FinalReleaseComObject(excelApp);
How can i solve this Problem Please sent solution ASAP.
Thank You.