Spreadsheet/Excel default format

I use the Daniel Berger's port of John McNamara's Excel module for
Perl. Everything works great, but it seems that there is no `default'
format - so cells (in Excel 2K) are black if they haven't been
formatted - and have `no color' in the format dialog. I just format
all around the area I'm using - but I was wondering if there is some
method of describing a default format?

Matt Maycock

···

--
There's no word in the English language for what you do to a dead
thing to make it stop chasing you.

Hi Matt,

Matt Maycock <ummaycoc@gmail.com> wrote in message news:<e86cebfb04081013522cb54c4@mail.gmail.com>...

I use the Daniel Berger's port of John McNamara's Excel module for
Perl. Everything works great, but it seems that there is no `default'
format - so cells (in Excel 2K) are black if they haven't been
formatted - and have `no color' in the format dialog. I just format
all around the area I'm using - but I was wondering if there is some
method of describing a default format?

Matt Maycock

Chris Thomas spotted this one as well a short while back. I seem to
have accidentally introduced this bug in 0.2.9. I believe commenting
out these lines (235-246) in format.rb will fix it:

# Assume a solid fill color if the bg_color or fg_color are set but
# the pattern value is not set
if (@pattern < 0x01) && (@bg_color != 0x41) && (@fg_color == 0x40)
   @fg_color = @bg_color
   @bg_color = 0x40
   @pattern = 1
end

if (@pattern < 0x01) && (@bg_color == 0x41) && (@fg_color != 0x41)
   @bg_color = 0x40
   @pattern = 1
end

I'm working on porting Spreadsheet::WriteExcel 2.x at the moment (I'm
about 3/4 done), so I doubt I'm going to go back and officially patch
this for the old version.

Also, please report bugs on the project page at
http://sourceforge.net/projects/rubyspreadsheet/\. It makes it easier
for me to track. I've also setup my own mailing list for the
spreadsheet package if you're interested - it's very low traffic. :slight_smile:

Thanks for the report.

Dan