You separate with comma when creating csv files, when creating xls files you want to separate with chr(9) like: rec.dept||chr(9)||rec.students