http://qs321.pair.com?node_id=1009204


in reply to Set Background Color Using Spreadsheet::SaveParser

The get_format() in the first line returns a Spreadsheet::ParseExcel Format object which doesn't have a set_color() method, or set_anything() method since it is a read/information only object.

Possibly you are getting it confused with a Spreadsheet::WriteExcel format method that you have in the same program. If that is the case, then you will have to map the Spreadsheet::ParseExcel format properties to Spreadsheet::WriteExcel format properties, one by one.

--
John.

  • Comment on Re: Set Background Color Using Spreadsheet::SaveParser

Replies are listed 'Best First'.
Re^2: Set Background Color Using Spreadsheet::SaveParser
by gw1500se (Beadle) on Dec 17, 2012 at 18:45 UTC
    Thanks for the reply. Not exactly confused as much as not understanding the capabilities of each. I thought SaveParser was a combined ParseExcel and WriteExcel, rather than something completely different. Logically, it seems that if I can add rows with SaveParser then I should also be able to set attributes on those rows. In any case, how do I go about updating an existing spreadsheet if not with SaveParser? Do I need to instead use both ParseExcel and WriteExcel instead? Can WriteExcel update and existing spreadsheet?
        Thanks again for the reply but I'm still stuck. If WriteExcel does not let me rewrite and existing spreadsheet and SaveParser does not let me 'set_color' I only see a brute force method to do what I need. I would have to use WriteExcel to create a new spreadsheet, then delete the old one and rename the new one. It seems like I am missing something or there is a big hole in these modules.

        P.S. If there is no 'set_color' method in SaverParser, why am I not getting a run time error when I try to use it?