I am using cells version 7 dll. While taking out the worksheets Gateway II and Gateway III of the attached file and saving them as separte files, we are getting thread abort exception. can you please investigate and provide the solution what is causing it and how to remedy it. Gateway I worksheet and saviing it as separte file works fine. Thank you.
I have attached the output file for your reference.
The code removes all the worksheets except the desired one.
Please also see the screenshot.
C#
string filePath = @“F:\Gateway±+Summary+Sheet.xls”;
Workbook workbook = new Workbook(filePath);
//Move the worksheet at index 0
Worksheet worksheet = workbook.Worksheets[“Gateway III”];
worksheet.Move(0);
//Remove all other worksheets
int idx = 0;
while (workbook.Worksheets.Count > 1)
{
workbook.Worksheets.RemoveAt(1);
}
//Save the workbook
workbook.Save(filePath + “.out.xls”);