as part of the changes coming with Moodle 1.6, a new Excel Generation API has been created and all the scripts using the old one, have been updated to use it.
Technically, it replaces the old "lib/excel/*" files and use their current evolution, as part of the PEAR package. But you can safely, ignore this. From Moodle 1.6, we will always generate Excel files by using the new "lib/excellib.class.php" wrapper classes, so changes in internal used libraries (i.e. PEAR for now) won't affect our code anymore.
Basically, all we need to write Excel files is:
require_once($CFG->libdir.'/excellib.class.php');
/// Calculate file name
$downloadfilename = clean_filename("thenameofthefile.xls");
/// Creating a workbook
$workbook = new MoodleExcelWorkbook("-");
/// Sending HTTP headers
$workbook->send($downloadfilename);
/// Adding the worksheet
$myxls =& $workbook->add_worksheet($strgrades);
/// Print cellls
$myxls->write_string(0,0,"Hello"));
$myxls->write_string(0,1,"Bye"));
/// Close the workbook
$workbook->close();
It supports some basic formatting (colours, borders, numbers...) and should work pretty well under any encoding (because, internally, everything is converted to UTF-16LE, that is a native supported encoding for excel files. The new classes are self-documented (PHP-Doc, I think) and should be easy to understand.
So, if we haven't forgot anything, all the current "excel generators" inside Moodle 1.6dev (gradebook, quiz reports, choice, hotpot, survey...) should be working properly using the new API. Please, update your code to use it. And test everything works as expected, reporting any problem you find.
Ciao