Error: Invalid row index: "0"

I have a report model spreadsheet in which I use the <#CONFIG> sheet to define the colors of some cells and, in each cell, I use the <#FORMAT CELL(COR1)> to define the cell formatting (and it works without problems).

Now I need to define the color of several cells in the spreadsheet, and to avoid having to place <#FORMAT CELL(COR1)> in each cell, I created a "Named Range" in the spreadsheet indicating which cells should be formatted.

The cells are distributed across the worksheet and the Named Range in the template (in Excel) was created as:

FORMATO_1 --> =Folha!$A$6;Folha!$A$11;Folha!$A$17

In the template I put:


When processing the report I receive the error "Invalid row index:"0"", whenever the cells that should be formatted are not in sequence.

If the Named Range is modified to:

FORMATO_1 --> =Folha!$A6:$A9

The report is processed without errors (and with the desired formatting).

What is the correct way to inform cells that are not in sequence in the <#FORMAT RANGE()> ?

Or the only way to do this in the template is to place <#FORMAT CELL(COR1)> in each cell of the spreadsheet?

Sadly the format_cell ranges must be continuous and rectangular, we don't accept any name. A name is any formula and might not even represent cells, like for example if you defined a name FORMATO_1->=A1+1 So we only accept ranges that are rectangular.

In your case, you might need 3 different names there, but yes, that's not much better than using format_cell directly


I solved this by creating my own TAG to format multiple cells:


Example of use:

{#FORMAT CELLS(COLOR_1;A1;B5;C10;D10:D25;K31)}

Comment: to not conflict with Flexcel's TAGs, the ones I create follow the pattern {#...}