Bug in column number encoding

Questions and answers on how to use XLSReadWriteII 3/4/5.
Post Reply
mik
Posts: 15
Joined: Fri Mar 05, 2010 1:01 am

Bug in column number encoding

Post 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!
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Bug in column number encoding

Post by larsa »

Hello

Thank you, this don't seems to be fixed. I will include a fix in the next update.
Lars Arvidsson, Axolot Data
Post Reply