Here is the way I do it...
<cfquery name="GetAll" datasource="#DSN#">
SELECT Field1, Field2, Field3, Field4
<cfheader name="Content-Disposition" value="filename=ReportName.csv">
<CFCONTENT reset="yes" TYPE="application/msexcel">
It should be noted that this solution sends a file to the client browser
which most would recognize as an Excel file and bring up an open or save
dialog box for this.
The original poster was talking about just writing a csv text file to
the server. I have never had trouble doing this, but it sounds like
some of your data may be unusually large numbers. How exactly are you
writing the file? What does the file look like before excel gets its
hands on it? I.E. what does it look like in a plain text editor such as