It´s possible to save a filter in Excel using COM API? This feature is very useful if you have someone else working with the same excel to have a different filter for each user.
I know there is a new Interfaces to do this job:
https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.interop.excel.sheetviews?view=excel-pia
CodePudding user response:
You need to enumerate the SheetViews collection that is a member of Application.ActiveWindow.
Application app = /*your_Excel_app*/;
var activeWindow = app.ActiveWindow;
foreach (WorksheetView view in activeWindow.SheetViews)
{
// do something
}