Apply Password to already Written XLS File.

I need to apply password protection to a xls file.I had looked at SpreadSheet::WriteExcel but problem being i dont want to write the contents of file again as the formatting the file would be a pain.

Is there way in which i write a entire file in one go , something like this

$sp->write(XLSFile);

and then just apply the

$sp->protect('password');

---------- Post updated 07-14-10 at 09:31 AM ---------- Previous update was 07-13-10 at 05:32 PM ----------

Anyone ?