I developed a SQLCLR stored procedure to refresh the pivot tables contained in a spreadsheet microsoft excel.
For every execution of the stored procedure, however, remains open on a task to excel. The only way to close is to act on the task manager. Have you any idea ?
Follows the sample code.
Excel.Application thisExcel = new Excel.Application();
Excel.Workbook theWorkbook = thisExcel.Workbooks._Open