• The code you posted is the same piece of code that I am trying to get work with only one modification.  You removed the credits!

    /*

    Version: SQL Server 7.0/2000

    Created by: Alexander Chigrik

    http://www.MSSQLCity.com/ - all about MS SQL

    (SQL Server Articles, FAQ, Scripts, Tips and Test Exams).

    This stored procedure can be used to insert the result set of the

    particular select statement into Excel file (c:\ImportToExcel.xls,

    by default).

    You can pass the server name, user name, user password, the select

    statement to execute, and the file name to store the results set,

    as in the example below:

    */

    Anyhow, I get a different error, but his thread is old and I'm not sure what I'm going to do to try to get it into Excel.