question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ws.autoFilter not working

See original GitHub issue

The docs mention the autoFilter option on a worksheet object. I attempted to enable it, but my worksheets still don’t open with autoFilter enabled.

ws.autoFilter = false as well as ws.autoFilter = true do nothing.

Does anyone know of a solution?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
SheetJSDevcommented, Jun 11, 2022

0.18.9 completely settles auto filter issues.

https://docs.sheetjs.com/docs/csf/sheet#worksheet-object ws["!autofilter"] will be assigned when parsing and will be serialized. It will also rewrite the relevant defined names for Excel formats.

1reaction
SheetJSDevcommented, Apr 7, 2017

The freeze options are set in the pane tag within the sheet views. In the XML it will appear right after the dimension tag, so https://github.com/SheetJS/js-xlsx/blob/master/bits/67_wsxml.js#L356 is probably the right place. I think something like this should take a parameter !freezerow in the worksheet: (warning: untested)

var freezerow = ws["!freezerow"] || 0;
if(freezerow > 0) { 
  var freezeref = "A" + encode_row(freezerow + 1);
  o[o.length] = '<sheetViews><sheetView tabSelected="1" workbookViewId="0"><pane ySplit="1" topLeftCell="' + freezeref + '" activePane="bottomLeft" state="frozen"/></sheetView></sheetViews>'
}

It might be necessary to add a selection within the sheetview <selection pane="bottomLeft" activeCell="A1" sqref="A1"/> but I haven’t experimented yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autofilter macro not working correctly | MrExcel Message Board
I need to have a vba macro to autofilter, then copy the results, without the header, to a different sheet. I have a...
Read more >
What to do when autofilter in VBA returns no data?
The trick is to include the header row in the call to the SpecialCells . This will ensure that at least 1 row...
Read more >
Range.AutoFilter method (Excel) - Microsoft Learn
Used with Criteria1 and Operator to construct compound criteria. Also used as single criteria on date fields filtering by date, month or year....
Read more >
Excel Filters AutoFilter Macros - Contextures
This Workbook_Open macro checks for an AutoFilter on the sheet named Data. It turns on the AutoFilter, if one is not in place....
Read more >
Excel VBA Autofilter: A Complete Guide with Examples
Note: I will cover this example (on filtering data based on a drop-down ... This simply means that if you can not see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found