Using the setSkipBlanks paste option does not work with Aspose Cells 24.7. Below is sample Java code and a ZIP containing the input and output Excel files that demonstrate this issue:
public static void main(String[] args) throws Exception {
Workbook workbook = new Workbook("./input.xlsx");
Worksheet targetSheet = workbook.getWorksheets().get(0);
Worksheet sourceSheet = workbook.getWorksheets().get(1);
Range targetRange = targetSheet.getCells().createRange(0, 0, 2, 2);
Range sourceRange = sourceSheet.getCells().createRange(0, 0, 2, 2);
PasteOptions options = new PasteOptions();
options.setSkipBlanks(true);
targetRange.copy(sourceRange, options);
workbook.save("./output.xlsx");
}
excel-files.zip (14.3 KB)
In the 2x2 source range, there are two blank cells, which should be skipped, thus leaving the two corresponding cells in the 2x2 target range unchanged. Aspose Cells does not behave the same way as Excel (Version 2405 Build 16.0.17628.20006).
Source range:
Target range before copy-paste:
Target range after pasting with Aspose (skip blanks true not working):
Target range after pasting with Excel (skip blanks true):
Excel special paste options used: