スライサーの削除
Contents
[
Hide
]
可能な使用シナリオ
Microsoft Excelでスライサーを削除する場合、それを選択して削除ボタンを押してください。同様に、Aspose.Cells for Python via .NET APIを使用してプログラム的に削除したい場合は、Worksheet.slicers.remove()メソッドを使用してください。これにより、ワークシートからスライサーが削除されます。
Aspose.Cells for Python Excel Libraryを使用したスライサーの削除方法
Aspose.Cellsはスライサーの形状のレンダリングをサポートしています。ワークシートを画像に変換したり、ワークブックをPDFやHTML形式で保存したりすると、スライサーが正しくレンダリングされます。
サンプルコード
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
from aspose.cells import SaveFormat, Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# Load sample Excel file containing slicer. | |
wb = Workbook("sampleRemovingSlicer.xlsx") | |
# Access first worksheet. | |
ws = wb.worksheets[0] | |
# Access the first slicer inside the slicer collection. | |
slicer = ws.slicers[0] | |
# Remove slicer. | |
ws.slicers.remove(slicer) | |
# Save the workbook in output XLSX format. | |
wb.save("outputRemovingSlicer.xlsx", SaveFormat.XLSX) |