I am using this code to enter a recordset from SQL Server 7.0 into Excel.


set rs = cnn1.Execute(SQL)

'Worksheets.Add.Activate
ActiveSheet.Name = "Lucent_Hist"
[a2].CopyFromRecordset rs
ActiveSheet.Columns.AutoFit




The query runs, and the sheet gets renamed, but the data does not populate the spreadsheet.

What is wrong?