in reply to Spreadsheet::WriteExcel to Browser Problem

You might have to add   binmode(XLS); before you start creating the spreadsheet. But that's probably not what's causing the problem you're seeing.

The WriteExcel documentation suggests using "-" to designate STDOUT.

print header("application/vnd.ms-excel"); binmode(STDOUT); my $wb = SpreadSheet::WriteExcel->new("-"); ...
If that's not sufficient, you might need to add the header  Content-Disposition: attachment; filename=text.xls (Also suggested by an example in the WriteExcel.pm docs.)

Update: You've probably already tested this, but does the machine on which you're running the browser have Excel installed, and will the browser invoke Excel for normal .xls files?

Update 2: Ignore all of this until you've resolved the problem tye identified below.