By default, the code after the SaveAs method won’t execute in Web platforms. This is because, Response.End() method has been invoked inside IWorkbook.SaveAs to download the generated Excel document. However, this can be resolved by saving workbook object in a memory stream and execute the code after that. Finally, send the stream into the method as given in the code snippet to achieve the requirement.
This page will automatically be redirected to the sign-in page in 10 seconds.