Support Portal

for ProcessRobot and WinAutomation

Start a new topic

Excel - Clear all filters in a non-macro workbook

Hello auto community!


I have an Excel file that I download from a SharePoint site using winautomation and do some processing with columns.


However the document has multiple users and it often has filters applied which effects the data I can extract. The problem is, it is a none-macro Excel file so I can't trigger any VB code.


I know that a macro such as this can clear all filters, but I can't enable macros on the worksheet.

  

Sub RemoveAllFilters()
    ActiveSheet.AutoFilter.ShowAllData
End Sub

Anyone got any good ideas as I'm stumped!


Thanks in advance,

David


Just to add a note I can record UI Automation Actions but it seems very unreliable (if someone hid a column it might break the automation).


Once I've cleared all filters I then need to add a filter on column M - sort oldest to newest and this doesn't seem to be recordable in the UI automation.



No worries, I added a different sheet where I calculate a max of the column data I need and just read that - it isn't effected by anyone filtering the main sheet.

Login or Signup to post a comment