@Raj1995Java,
Thanks for the code segment and details.
I have evaluated your scenario/ case a bit. The issue is not related to Aspose.Cells APIs by any means. To resolve your issue, you may try using/setting StandardCopyOption.REPLACE_EXISTING option for java.nio.file.Files.move() overloaded method. See the updated code segment which works fine as I tested:
e.g
Sample code:
........
for(int i = 0;i<6;i++)
{
com.aspose.cells.Workbook sortinWorkbook;
String FILE_NAME="f:\\files\\OriginalFile.xlsx";
sortinWorkbook=new com.aspose.cells.Workbook(FILE_NAME);
File checkDirectory=new File(FILE_NAME);
if(checkDirectory.exists()){
Files.move(Paths.get(FILE_NAME), Paths.get("e:\\test2\\TempSorting1.xlsx"), StandardCopyOption.REPLACE_EXISTING);
}
sortinWorkbook.save(FILE_NAME);
}
By the way, you do not need to move the file to other location as Aspose.Cells would automatically replace the existing file (remove the existing file and generate new).