スライサーの削除
Contents
[
Hide
]
考えられる使用シナリオ
Microsoft Excel でスライサーを削除する場合は、それを選択して、消去ボタン。同様に、プログラムで Aspose.Cells API を使用して削除する場合は、Worksheet.Slicers.Remove()方法。ワークシートからスライサーが削除されます。
スライサーの削除
次のサンプル コードは、サンプル Excel ファイル既存のスライサーが含まれています。スライサーにアクセスしてから削除します。最後に、ワークブックを次のように保存します。出力エクセルファイル.次のスクリーンショットは、サンプル コードの実行後に削除されるスライサーを示しています。
サンプルコード
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Load sample Excel file containing slicer. | |
Workbook wb = new Workbook("sampleRemovingSlicer.xlsx"); | |
// Access first worksheet. | |
Worksheet ws = wb.Worksheets[0]; | |
// Access the first slicer inside the slicer collection. | |
Aspose.Cells.Slicers.Slicer slicer = ws.Slicers[0]; | |
// Remove slicer. | |
ws.Slicers.Remove(slicer); | |
// Save the workbook in output XLSX format. | |
wb.Save("outputRemovingSlicer.xlsx", SaveFormat.Xlsx); |