Cannot format Ranges (part 2)

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
obeltrami
Posts: 15
Joined: Tue Jun 23, 2015 6:11 pm

Cannot format Ranges (part 2)

Post by obeltrami »

Hello,

I am returning to the topic of conversion of Formatting Ranges from v.4 to v.5, which remained open when you left on holidays in June. I have spent most of the past 6 weeks adapting the code that used to format with "Range.Items[]" to use "CmdFormat". What a nightmare !!! Each single line now becomes 4 or more lines of code.

Still, I am getting the knack of converting the code to v.5 for text. However, I am still having problems with cell borders.

1) There seems to be an "off by one" bug in the code that manages Border.Side[] as the formatting is always applied to the previous column or previous row than the one specified.

2) Most importantly, I cannot find a way to set, for example, the right side of a range of cells. If I use cbspOutline it does the right side OK, but damages the right side of the range on the left. If I try cbspNone then nothing happens. How can I get the same result under v.5 as I was getting under v.4 for

Code: Select all

Range.Items[bufCol,minRow,bufCol,maxRow].BorderRightStyle := cbsThin;
for example, and not have other borders be changed ?

Very best regards,

Olivier
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Cannot format Ranges (part 2)

Post by larsa »

Hello

Can you please create a small sample that reproduces the problem?
Lars Arvidsson, Axolot Data
obeltrami
Posts: 15
Joined: Tue Jun 23, 2015 6:11 pm

Re: Cannot format Ranges (part 2)

Post by obeltrami »

OK, I'll put something together later today or tomorrow.
obeltrami
Posts: 15
Joined: Tue Jun 23, 2015 6:11 pm

Re: Cannot format Ranges (part 2)

Post by obeltrami »

I just sent you the sample project by email.
Post Reply