Page 1 of 1

Bug in column number encoding

Posted: Mon Mar 15, 2010 4:18 pm
by mik
I don’t know if this already has been reported and fixed. It’s possible that I’m using the obsolete version of XLSUtils4.pas, though I downloaded it rather recently.
I found that the encoding algorithm implemented in XLSUtils4.ColRowToRefStrEx12 works incorrectly for column numbers >675. Apparently this is due to ignoring 1 and 2 character codes. As a result number 676 is converted to “BAA” instead of “ZA”.

When I replace line

else if ACol < 676 then

with

else if ACol < 676+26 then

and insert operator

Dec(ACol,676+26);

immediately before

C := ACol div 676;

everything starts working normally.

Please let me know if the fix is available.

Thanks!

Re: Bug in column number encoding

Posted: Mon Mar 15, 2010 4:49 pm
by larsa
Hello

Thank you, this don't seems to be fixed. I will include a fix in the next update.