0
votes

I have an c# project which automates excel using the excel interop. One issue that I am running into is sorting using the excel filters, when I protect the sheet using C#, I am disabling sorting, when I unprotect it I am able to use the filters in the ListObject to sort. Given that I need to protect the sheet is their a C# event that can tell me when a user selected the header of the list Object column and select Sort A to Z or Largest to smallest Thanks

2

2 Answers

0
votes

You're not going to get anything in C# that isn't available via the Excel object model. If such an event exists, it would probably have some form of it on the Application object (the Application object has events like SheetBeforeDoubleClick that are duplicates of the events that happen on the individual books/sheets like the BeforeDoubleClick event of the Worksheet object).

The SheetTableUpdate event may help you.

http://msdn.microsoft.com/en-us/library/office/microsoft.office.interop.excel.application_events.aspx

0
votes

This is kind of outdated and you mention no Excel version but from what I gather, I think this may be able to help you.

Sort Excel table (ListObject) on protected sheet using Excel Interop c#