Hi everyone!
I’m new to onyloffice, but it works like a charm from the start!
However, i was trying to replicate a “reset”-button for the conditional formatting of a sheet. The problem arises from the weird EXCEL-behaviour that copies all conditional formatting even if the sheet is protected. E.g. my conditional fomatting for the very cleanly defined range $A$2:$CZ$32 gets scrambled to a monsterlike thing like “$A$2:$CZ$9,$A$10:$D$13,$F$10:$CZ$13,$A$14:$CZ$32,$CZ$1,$J$21:$J$24” only because i cut a few cells and copied them somewhere else. (PS: if there is a way to protect this then this would be the easier solution, but EXCEL behaves like this too, and i guess you want to replicate this)
So in order to get back to the clean definition of $A$2:$CZ$32, what i do is delete all conditional formatting in that range and change the range of the formatting of a single cell at the end of the table ($CZ$1) which contains the same conditional formatting.
I’ve skimmed through the API-documentation and found out how to fill cells via macro etc., but i havent found how to influence or manipulate the conditional formatting.
Does this even already exist in the API?
i hope i have outlined my problem well and am happy to hear from someone willing to help.
PS: the following is my current EXCEL Macro doing the job:
Sub BedFormatKorrigieren()
Range("$A$2:$CZ$32").FormatConditions.Delete
BedingteFormatierungenAnzahl = Range("$CZ$1").FormatConditions.Count
For i = 1 To BedingteFormatierungenAnzahl
Range("$CZ$1").FormatConditions(i).ModifyAppliesToRange Range("$A$2:$CZ$32,$CZ$1")
Next
Application.Calculate
End Sub