Hallo,

folgendes Problem:

Gegeben sei folgende kleine CALC-Tabelle

|1|4|1|4|
|2|3|2|3|
|3|2|3|2|
|4|1|4|1|

und dieser BasicMakro-Code:

Sub BedingteFormatierung

Dim oBF  as Object ' obj Bedingung Format (Conditional Format)
Dim oBFB as Object ' obj Bedingung Format Bereich
Dim oB(2) as New com.sun.star.beans.PropertyValue ' Bedingung (Condition)

oBFB = ThisComponent.Sheets(0).getCellRangeByPosition(0,0,3,3)
oBF = oBFB.ConditionalFormat

oB(0).Name = "Operator"
oB(0).Value = com.sun.star.sheet.ConditionOperator.FORMULA
oB(1).Name = "Formula1"
oB(1).Value = "INDIREKT(ADRESSE(ZEILE();SPALTE()))-INDIREKT(ADRESSE(ZEILE()-1;SPALTE())) < 0"
oB(2).Name = "StyleName"
oB(2).Value = "Bad"

oBF.addNew(oB())
oBFB.ConditionalFormat = oBF

End Sub

Nach Ausführung des Makros sind der "Bereich" ( oBFB ), die "Bedingung" ( oB(1).Value ) und die "Vorlage" ( oB(2).Value ) richtig eingetragen, aber die so eingetragene "bedingte Formatierung" ist nicht aktiv, d.h., keine Einfärbung der betroffenen Zellen gemäß "Vorlage".

Nach manuell

[Format] > [Bedingte Formatierung] > [Verwalten...] > [Bearbeiten] > [OK] > [OK]

ist die "bedingte Formatierung" aktiv und die entsprechenden Zellen sind sofort eingefärbt.

Der BasicMakro-Code ist sowohl bei Pitonyak/Lenhardt als auch Dannenhöfer so angegeben wie oben. Mir ist jedenfalls kein Unterschied aufgefallen ...

Habe ich da noch irgendeinen Fehler in meinem BasicMakro-Code ?
Fehlt da noch was, um die "bedingte Formatierung" zu aktivieren oder liegt da ein BUG vor ?

Mir fällt im Moment nichts weiter ein,
bin für jeden Hinweis dankbar

Grüße
Hans-Werner :-))




--
Liste abmelden mit E-Mail an: users+unsubscr...@de.libreoffice.org
Probleme? 
https://de.libreoffice.org/hilfe-kontakt/mailing-listen/abmeldung-liste/
Tipps zu Listenmails: https://wiki.documentfoundation.org/Netiquette/de
Listenarchiv: https://listarchives.libreoffice.org/de/users/
Datenschutzerklärung: https://www.documentfoundation.org/privacy

Antwort per Email an