You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by Vladislav Stevanovic <st...@gmail.com> on 2014/10/25 01:06:01 UTC

Access to the list of Autofilter

Hello,

Is it possible with code in Basic to access to the list of Autofilter data
in Calc? Reason: filtering with basic is limited maximum with 3 criteria...
Because I need more then 3 criteria I want with basic code  to use
filtering capability of Autofilter.

Thanks in advance,
Wlada

Re: Access to the list of Autofilter

Posted by Andreas Säger <sa...@t-online.de>.
Am 25.10.2014 um 01:06 schrieb Vladislav Stevanovic:
> Hello,
> 
> Is it possible with code in Basic to access to the list of Autofilter data
> in Calc? Reason: filtering with basic is limited maximum with 3 criteria...
> Because I need more then 3 criteria I want with basic code  to use
> filtering capability of Autofilter.
> 
> Thanks in advance,
> Wlada
> 

This is the mailing list of the developers (not macro coders).

Register on the support forum:
> https://forum.openoffice.org/en/forum/ucp.php?mode=register

Filter criteria are limited to 8 criteria. No macros can not access the
auto-filter list.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: Access to the list of Autofilter

Posted by Andreas Säger <sa...@t-online.de>.
Am 25.10.2014 um 20:36 schrieb Vladislav Stevanovic:

>> Filter criteria are limited to 8 criteria.
> Is it capability for Autofilter?
> 

There is no auto filter. There is only one filter for a range and the
GUI provides 3 methods (drop down, dialog, cell range) to set up this
filter. Your macro would be the 4th method then.
OpenOffice has a database component. Databases are designed to do what
so many people try so desperately to do on calculator sheets.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: Access to the list of Autofilter

Posted by Vladislav Stevanovic <st...@gmail.com>.
>This is the mailing list of the developers (not macro coders).
>Register on the support forum:
> https://forum.openoffice.org/en/forum/ucp.php?mode=register

Andreas you're right, I am sorry about that.

>Filter criteria are limited to 8 criteria.
Is it capability for Autofilter?

> No macros can not access the auto-filter list.
I am not happy for that. Thanks for information.

Andrew, thanks for your respons.

Regards,
Wlada



2014-10-25 6:26 GMT+02:00 Andrew Douglas Pitonyak <an...@pitonyak.org>:

> On 10/24/2014 07:06 PM, Vladislav Stevanovic wrote:
>
>> Hello,
>>
>> Is it possible with code in Basic to access to the list of Autofilter data
>> in Calc? Reason: filtering with basic is limited maximum with 3
>> criteria...
>> Because I need more then 3 criteria I want with basic code  to use
>> filtering capability of Autofilter.
>>
>> Thanks in advance,
>> Wlada
>>
>>  First, Andreas is correct, you should post these types of questions to
> the forum not the Dev list.
>
> Second, I wrote a document called "Calc As A Simple Database" that is now
> part of the official LibreOffice documentation that has a macro called
> AddNewDatabaseRange that sets a range to use an autofilter.
>
> If you look at OOME, available from my web site, I also demonstrate how to
> create and use regular filters using macros. I expect that this is also in
> the aforementioned document.
>
> Sub AddNewDatabaseRange()
>   Dim oRange 'DatabaseRange object.
>   Dim oAddr  'Cell address range for the database range.
>   Dim oSheet 'First sheet, which will contain the range.
>   Dim oDoc   'Reference ThisComponent with a shorter name.
>
>   oDoc = ThisComponent
>   If NOT oDoc.DatabaseRanges.hasByName("MyName") Then
>     oSheet = ThisComponent.getSheets().getByIndex(0)
>     oRange = oSheet.getCellRangeByName("A1:F10")
>     oAddr = oRange.getRangeAddress()
>     oDoc.DatabaseRanges.addNewByName("MyName", oAddr)
>   End If
>   oRange = oDoc.DatabaseRanges.getByName("MyName")
>   oRange.AutoFilter = True
> End Sub
>
> --
> Andrew Pitonyak
> My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
> Info:  http://www.pitonyak.org/oo.php
>
>

Re: Access to the list of Autofilter

Posted by Andrew Douglas Pitonyak <an...@pitonyak.org>.
On 10/24/2014 07:06 PM, Vladislav Stevanovic wrote:
> Hello,
>
> Is it possible with code in Basic to access to the list of Autofilter data
> in Calc? Reason: filtering with basic is limited maximum with 3 criteria...
> Because I need more then 3 criteria I want with basic code  to use
> filtering capability of Autofilter.
>
> Thanks in advance,
> Wlada
>
First, Andreas is correct, you should post these types of questions to 
the forum not the Dev list.

Second, I wrote a document called "Calc As A Simple Database" that is 
now part of the official LibreOffice documentation that has a macro 
called AddNewDatabaseRange that sets a range to use an autofilter.

If you look at OOME, available from my web site, I also demonstrate how 
to create and use regular filters using macros. I expect that this is 
also in the aforementioned document.

Sub AddNewDatabaseRange()
   Dim oRange 'DatabaseRange object.
   Dim oAddr  'Cell address range for the database range.
   Dim oSheet 'First sheet, which will contain the range.
   Dim oDoc   'Reference ThisComponent with a shorter name.

   oDoc = ThisComponent
   If NOT oDoc.DatabaseRanges.hasByName("MyName") Then
     oSheet = ThisComponent.getSheets().getByIndex(0)
     oRange = oSheet.getCellRangeByName("A1:F10")
     oAddr = oRange.getRangeAddress()
     oDoc.DatabaseRanges.addNewByName("MyName", oAddr)
   End If
   oRange = oDoc.DatabaseRanges.getByName("MyName")
   oRange.AutoFilter = True
End Sub

-- 
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php