Bug 107238 - VBA autofilter needs support for list of strings arguments
Summary: VBA autofilter needs support for list of strings arguments
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
Whiteboard: target:5.4.0
Keywords: difficultyInteresting, easyHack, skillCpp, skillDebug
Depends on:
Blocks: 107797
  Show dependency treegraph
Reported: 2017-04-18 03:58 UTC by Aron Budea
Modified: 2017-05-13 17:38 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:

Sample XLSM (13.57 KB, application/vnd.ms-excel.sheet.macroEnabled.12)
2017-04-18 03:58 UTC, Aron Budea

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2017-04-18 03:58:54 UTC
Created attachment 132647 [details]
Sample XLSM

Open the attached XLSM file containing two columns with data, and a recorded VBA macro (Module1 / AF) that selects the data, creates autofilter for them, and hides 1 data row of the 4.

However, in Calc after running the macro all data rows get hidden, not just one.

Observed with LO and / Windows 7.
Comment 1 Xisco Faulí 2017-04-18 08:20:51 UTC
Confirmed in

Build ID: 7635e0c1c7f821a1081f8e3868f641ae74a172d6
CPU threads: 4; OS: Linux 4.8; UI render: default; VCL: gtk2; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group


LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-
Comment 2 Markus Mohrhard 2017-04-20 04:28:29 UTC
Let's make this an easy hack.

The issue is in the criteria detection in ScVbaRange which does not handle string arrays and as a result tries to filter for "".

The code for this is in sc/source/ui/vba/vbarange.cxx:4508 and following which currently only handles numeric and string values but would need to be extended to handle css::uno::Sequence<OUString> as well.

This task is to add the support and check how to transport the information through the UNO API to the internal data structures.
Comment 3 Commit Notification 2017-05-12 09:26:17 UTC
Szymon Kłos committed a patch related to this issue.
It has been pushed to "master":


tdf#107238 VBA autofilter: list of strings

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:

Affected users are encouraged to test the fix and report feedback.