size of cell comments

1 view
Skip to first unread message

JohnCombine

unread,
Jan 4, 2007, 6:09:27 PM1/4/07
to Spreadsheet::WriteExcel
John:
I have noticed an upper limit on the length of a string that can be
written in a cell comment.

If a string longer than 8219 characters is written using
$worksheet->write_comment(), then the file becomes corrupt, and excel
must 'fix' it to load (stripping out all formats and comments, showing
raw data only). Excel itself can handle longer comments.

This only became an issue for me when I upgraded from v0.43 to v2.17 of
Spreadsheet::WriteExcel. v0.43 can write those long comments just
fine, but v2.17 creates a corrupt file.

This upper limit is not documented anywhere that I can find. Is there
any additional information you can think of about this issue?

Thank you

jmcnamara

unread,
Jan 5, 2007, 9:03:04 PM1/5/07
to Spreadsheet::WriteExcel
JohnCombine wrote:
> John:
> I have noticed an upper limit on the length of a string that can be
> written in a cell comment.
>
> If a string longer than 8219 characters is written using
> $worksheet->write_comment(), then the file becomes corrupt.

Hi John,

A bug I'm afraid.

I'll try fix it for the next release.

John.
--

jmcnamara

unread,
Jan 15, 2007, 8:37:06 PM1/15/07
to Spreadsheet::WriteExcel
Hi John,

Can you try the following fix and let me know how it works out:

http://homepage.eircom.net/~jmcnamara/perl/prerel/Spreadsheet-WriteExcel-2.17.4.tar.gz

John.
--

JohnCombine

unread,
Jan 16, 2007, 12:32:56 PM1/16/07
to Spreadsheet::WriteExcel
The worked as expected.

My example, with about 9000 latin1 characters printed fine, and the
resultant file is uncorrupted.

Are there new limits to size of the comment field with this new
version?

And, is my assumption correct that this limit is halved when writing
utf8 characters?

jmcnamara

unread,
Jan 16, 2007, 5:36:39 PM1/16/07
to Spreadsheet::WriteExcel
JohnCombine wrote:
> The worked as expected.
>
> My example, with about 9000 latin1 characters printed fine, and the
> resultant file is uncorrupted.
>
> Are there new limits to size of the comment field with this new
> version?

Hi,

Thanks for testing it.

The string limit should be 32k characters although I haven't checked
that yet.


> And, is my assumption correct that this limit is halved when writing
> utf8 characters?

The limit is in characters, not bytes, so the limit is the same for
ASCII or UTF-8.

John.
--

Reply all
Reply to author
Forward
0 new messages