http://www.perlmonks.org?node_id=868975


in reply to OpenOffice Calc/Spreadsheets & Win32::OLE

Writing an XML file is often the easiest way.   Start with an existing spreadsheet template, with named cell-ranges and so on, formatted “just the way you like it” except for data.   Save this template as XML.

Now, use standard XML/XPath techniques.   Locate the named cell-ranges in this way and update them as needed.   I advise strongly that you should write your code in this way, using a “beautiful empty spreadsheet” as its input, rather than writing complex Perl code to generate those extras.   Someone should be able to change the appearance of the spreadsheet without changing your code, ’cuz you can guarantee that this sort of thing will happen constantly.   (“Dress for success.”   Management tends to care a whole lot more for how the spreadsheet looks than for ...)

If you save (or send) the XML data with the usual .XLS file extension, It Just Works.™

  • Comment on Re: OpenOffice Calc/Spreadsheets & Win32::OLE