You say you want an .xls file and then you create a .csv file?
In any case, SQL Server is not a file-export tool. If you want to make this a job, make it a CMDExec or PowerShell step and run SQLCMD directly.
If you actually want an XLS file, you can drive this from PowerShell directly. Here is a demo script that I have that runs a query and writes to an Excel file:
using namespace System.Data;
using namespace System.Data.SqlClient;
$excel = New-Object -ComObject Excel.Application;
$book = $excel.WorkBooks.Add();
$sheet = $book.WorkSheets.Item(1);
$connstr = "Database=Northgale;Integrated Security=SSPI;Server=."; # Beware to change the Server name to your environment!
$cn = New-Object SqlConnection $connstr;
$cn.Open();
$cmd = New-Object SqlCommand(
"SELECT TOP 1000 * FROM dbo.Customers", $cn);
$cmd.CommandType = [CommandType]::Text;
$da = New-Object SqlDataAdapter($cmd);
$dt = New-Object DataTable;
$nrows = $da.Fill($dt);
$stopwatch = [System.Diagnostics.Stopwatch]::StartNew();
$ncols = $dt.Columns.Count;
$values = [System.Object[,]]::new($nrows, $ncols);
$rowno = 0;
foreach ($row in $dt.Rows) {
$colno = 0;
foreach ($item in $row.ItemArray) {
$values[$rowno, $colno++] = $item.ToString();
}
$rowno++;
}
$sheet.Range($sheet.Cells(1, 1),
$sheet.Cells($nrows, $ncols)) = $values;
$stopwatch.Stop();
[console]::WriteLine("Duration {0:F2} seconds.",
$stopwatch.Elapsed.TotalSeconds);
$cmd.Dispose();
$cn.Close();
$cn.Dispose();
$excel.Visible = 1; # DON'T INCLUDE THIS LINE IN AGENT JOB!
Note that since is for demo purposes, I don't actually save the file. That is left as an exercise to the reader. As is adding the column headers.