Refresh Problem - Creating Conditional Formats with Macro

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
markovian
Posts: 3
Joined: Wed Mar 02, 2011 11:53 pm

Refresh Problem - Creating Conditional Formats with Macro

Post by markovian »

This is a followup to my previous post on creating Conditional Formatting using a Basic Macro that was fixed:
http://user.services.openoffice.org/en/ ... 45&t=38922

The Basic Macro I created works great to create conditional formats on a selection, unless I use a a compound condition (i.e. AND(test1, test2). When a compound condition is created, everything gets written into the ConditionalFormat Property correctly, but the actual cell formatting doesn't refresh unless you bring up the Conditional Formatting GUI and hit enter. The problem with doing this (bringing the Conditional Formatting GUI and hitting enter) is that it wipes out Conditional Formats 4, 5, 6, 7, .... (since we are limited to 3 Condition Formats in the gui).

I think this is a bug, but maybe there's a way to say "Refresh Formatting" that could be called after creating the Conditional Formats. I couldnt' find this method though.

See a screencast of the problem at the following link:
http://www.screencast-o-matic.com/watch/cXeiFQ23D
Note: In the screencast notice that the 1st 3 Conditions "take hold" when hitting enter, but the 4th Condition ("Browns") and beyond are lost.
Attachments
CreateConditionalFormatting_RefreshProblem.ods
(16.51 KiB) Downloaded 436 times
LibreOffice 3.3.1 on Fedora, Linux Mint Debian Edition, & Windows XP
edogd
Posts: 4
Joined: Mon May 23, 2011 8:16 pm

Re: Refresh Problem - Creating Conditional Formats with Macr

Post by edogd »

I observed the same problem.
I found that I had to reset the property value of both ConditionalFormat and ConditionalFormatLocal.

Code: Select all

	oSelectionRange.setPropertyValue("ConditionalFormat", oSelectionConditions)	
	oSelectionRange.setPropertyValue("ConditionalFormatLocal", oSelectionConditions)	
OpenOffice 3.3 on FC13 / LibreOffice 3.3 on Windows XP and CentOS
kim88

Re: Refresh Problem - Creating Conditional Formats with Macr

Post by kim88 »

Unfortunately it didn't help me
don't understand why..... :crazy:
ptoye
Posts: 225
Joined: Mon Apr 21, 2008 11:07 am
Location: Reading, England

Re: Refresh Problem - Creating Conditional Formats with Macr

Post by ptoye »

Markovian - did you ever sort this out? I want to do a similar thing with a formula with 4 conditions ANDed together. And I don't want to spend ages just to find out that it's impossible!
Peter
OO 4.1.1 on MS Windows 7 64-bit
dech
Posts: 21
Joined: Wed Sep 01, 2010 12:32 am

Re: Refresh Problem - Creating Conditional Formats with Macr

Post by dech »

hi guys...i dont want to use more than 3 conditions...BUT I want to get rid of...bringing the GUI up and clicking "OK" to let the formula actually calculate. After hiting "OK" the cell gets proper format (according to formula).
Do you know why is this happenin...actually not happenin = why is the formula not calculating it self?
thanks.
LO 5.2.7.2
Post Reply