[]
Use this class with IRange.copy(IRange,PasteOption) to specify whether hidden cells are included in the paste operation and which PasteType values are pasted. A new instance allows pasting hidden ranges by default, and its default paste type includes formulas and formats.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Name", "Value"},
{"Alice", 100},
{"Bob", 200}
});
worksheet.getRange("2:2").setHidden(true);
PasteOption option = new PasteOption();
option.setAllowPasteHiddenRange(false);
worksheet.getRange("A1:B3").copy(worksheet.getRange("D10"), option);
booleanvoidsetAllowPasteHiddenRange(boolean allowPasteHiddenRange) voidsetPasteType(EnumSet<PasteType> pasteType) Use this property with IRange.copy(IRange,PasteOption) to determine whether content from hidden rows or columns is pasted. A new PasteOption instance allows pasting hidden ranges by default.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Name", "Value"},
{"Alice", 100},
{"Bob", 200}
});
worksheet.getRange("2:2").setHidden(true);
PasteOption option = new PasteOption();
option.setAllowPasteHiddenRange(false);
boolean allowPasteHiddenRange = option.getAllowPasteHiddenRange();
worksheet.getRange("A1:B3").copy(worksheet.getRange("D10"), option);
true if hidden cells in the copied range are included in the paste operation; otherwise, false.Use this property with IRange.copy(IRange,PasteOption) to determine whether content from hidden rows or columns is pasted. A new PasteOption instance allows pasting hidden ranges by default.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Name", "Value"},
{"Alice", 100},
{"Bob", 200}
});
worksheet.getRange("2:2").setHidden(true);
PasteOption option = new PasteOption();
option.setAllowPasteHiddenRange(false);
worksheet.getRange("A1:B3").copy(worksheet.getRange("D10"), option);
allowPasteHiddenRange - true if hidden cells in the copied range are included in the paste operation; otherwise, false.Use this method with IRange.copy(IRange,PasteOption) to inspect or reuse the current paste configuration. A new PasteOption instance returns a set containing PasteType.Formulas and PasteType.Formats by default.
worksheet.getRange("A1").setFormula("=1+1");
worksheet.getRange("A1").getInterior().setColor(Color.GetYellow());
PasteOption option = new PasteOption();
option.setPasteType(EnumSet.of(PasteType.Values));
worksheet.getRange("A1").copy(worksheet.getRange("B1"), option);
EnumSet<PasteType> pasteTypes = option.getPasteType();
PasteType values that controls which parts of the source range are pasted.Use this method with IRange.copy(IRange,PasteOption) to specify which parts of the source range are pasted. A new PasteOption instance includes PasteType.Formulas and PasteType.Formats by default.
worksheet.getRange("A1").setFormula("=1+1");
worksheet.getRange("A1").getInterior().setColor(Color.GetYellow());
PasteOption option = new PasteOption();
option.setPasteType(EnumSet.of(PasteType.Values));
worksheet.getRange("A1").copy(worksheet.getRange("B1"), option);
pasteType - The set of PasteType values that controls which parts of the source range are pasted.