Hi @Caroll Susairaj ! Your question doesn't appear to be related to Office Scripts - could you remove the 'office-scripts-excel-dev' tag? Thank you so much!
Warmly,
Nancy
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I could able to create a pivot table using openxml C# but unable to find a way on linking slicers using C#. Can some one help me on this.
Hi @Caroll Susairaj ! Your question doesn't appear to be related to Office Scripts - could you remove the 'office-scripts-excel-dev' tag? Thank you so much!
Warmly,
Nancy
Could you please show some existing code? Let us move on based on your code.
Besides, can we use other packages?
I often use Microsoft.Office.Interop.Excel, here are some codes written in this package:
Application application = new Application();
Workbook oWorkbook = application.Workbooks.Open(@"C:\...\1.xlsx");
try
{
Worksheet oWorksheet = (Worksheet)oWorkbook.ActiveSheet;
SlicerCaches oSlicerCaches = oWorkbook.SlicerCaches;
SlicerCache slicerCache = oSlicerCaches.Add2(oWorksheet.ListObjects["Table1"], "Column1", "mSlicer");
slicerCache.Slicers.Add(oWorksheet, System.Reflection.Missing.Value, "Column1", "testSlicer", 100,
400, 150, 200);
}
catch (Exception e)
{
Console.WriteLine(e);
}
finally
{
oWorkbook.Save();
oWorkbook.Close();
application.Quit();
}
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.