//to genrate EXCEL files
require_once(\'documentation/Excel_Writer/Writer.php\');
if($_POST[\'submit\'] == \"Email as EXCEL\"){
// get values
$dated1=
1) i have modified ur piece of code, try using this
$worksheet->write(0, 0, "TransactionID");
$worksheet->write(1, 0, $format_bold);
$worksheet->write(0, 1, "Date");
$worksheet->write(1, 1,$format_bold);
$worksheet->write(0, 2, "Type");
$worksheet->write(1, 2, $format_bold);
$worksheet->write(0, 3, "Transaction Details");
$worksheet->write(1, 3, $format_bold);
$worksheet->write(0, 4, "Currency");
$worksheet->write(1, 4, $format_bold);
$worksheet->write(0, 5, "Amount");
$worksheet->write(1, 5, $format_bold);
$worksheet->write(0, 6, "Balance");
$worksheet->write(1, 6, $format_bold);
And according to the above code modify the code inside for loop.
2) "$worksheet =& $workbook->addWorksheet();"
Add some name to your workbooksheet
e.g $workbook = new Spreadsheet_Excel_Writer($excelfillename);