@psfung
Thanks for using Aspose APIs.
Please use the Workbook.Worksheets.ActiveSheetIndex for your needs. Please see the following sample code, its sample Excel file and its output Text files for your help.
Download Link:
Sample Excel and Output Text Files.zip (7.6 KB)
Java
Workbook book = new Workbook(dirPath + "sample.xlsx");
TxtSaveOptions opts = new TxtSaveOptions();
opts.setSeparator('\t');
for(int i=0; i<book.getWorksheets().getCount(); i++)
{
book.getWorksheets().setActiveSheetIndex(i);
Worksheet sh = book.getWorksheets().get(i);
book.save(dirPath + "out-" + sh.getName() + ".txt");
}//for
C#
Workbook book = new Workbook("sample.xlsx");
TxtSaveOptions opts = new TxtSaveOptions();
opts.Separator = '\t';
for(int i=0; i<book.Worksheets.Count; i++)
{
book.Worksheets.ActiveSheetIndex = i;
Worksheet sh = book.Worksheets[i];
book.Save("out-" + sh.Name + ".txt");
}//for