Philip Newton (pne) wrote,
Philip Newton

  • Mood:

Creating an Excel spreadsheet on-the-fly

Warning: Geekery ahead.

So I decided to make new home teaching lists. The previous ones were in Excel, so it's probably a nice idea to make the new ones in Excel, too. But I have the data in a database on a Linux machine now.

Not a big problem, thanks to John McNamara and his Spreadsheet::WriteExcel module. I studied the docs for a while and tinkered with the script a bit. I used a script that already makes home teaching lists in HTML format as a base.

It actually worked all right, except for the birthdates: my (German) version of Excel 97 always showed them as numbers. I tried playing around with the num_format option but nothing appeared to happen (though at some settings, I got a warning from Excel when it loaded the file). Grr.

After several tries, I gave up and decided to write the birthdates as strings rather than Excel dates (which are numbers internally: fractional days since 0 January 1900 = 31 December 1899). *sigh*

But the rest works, and the file looks rather similar to the original! Whee.

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded