Updating Slicer

Possible Usage Scenarios

If you want to update slicer in Microsoft Excel, select or unselect its items, it will then update the slicer table or pivot table accordingly. Please use Slicer.SlicerCache.SlicerCacheItems to select or unselect slicer items with Aspose.Cells and then call Slicer.refresh() method to update the slicer table or pivot table. 

Updating Slicer

The following sample code loads the sample Excel file that contains an existing slicer. It unselects the 2nd and 3rd items of the slicer and refreshes the slicer. It then saves the workbook as the output Excel file. The following screenshot shows the effect of the sample code on the sample Excel file. As you can see in the screenshot, refreshing the slicer with selected items has also refreshed the pivot table accordingly.

todo:image_alt_text

Sample Code