If you're using asp, you can create the excel file using xml like this....
<%
response.expires = 0
monNum = month(date())
dayNum = day(date())
if monNum < 10 then monNum = "0" & monNum
if dayNum < 10 then dayNum = "0" & dayNum
g_filename="report/ThreeDayReport"& "_" & year(date()) & monNum & dayNum &".xls"
set fso = createobject("scripting.filesystemobject"
if fso.FileExists(server.mappath(g_fileName)) then
''response.write ("found"

else
Set objConn = Server.CreateObject( "ADODB.Connection" )
Set objCmd = Server.CreateObject( "ADODB.Command" )
objConn.Open Application("connectString"

Set objCmd.ActiveConnection = objConn
objCmd.CommandTimeout = 300
with objCmd
.commandText = "br_sp_threeDayReport"
.CommandType = &H0004
End With
set objrs = objcmd.execute()
recCount = 0
'this routine is simply writing a HTML table'
do while not objrs.eof
if lcase(objrs("created"

) <> "null" then
if lastName <> "" then
if lastName <> objrs("lastName"

then strOut = strOut & "<tr></tr>" '<
end if
recCount = recCount + 1
lastName = objrs("lastName"

end if
strOut = strOut & "<td style='width: 100px'>" & objrs(0) & "</td>"
objrs.movenext
loop
if recCount > 0 then ' <'records found'
Set act = fso.CreateTextFile(server.mappath(g_filename), true)
with act
.WriteLine "<html xmlns:x=""urn:schemas-microsoft-com

ffice:excel"">"
.WriteLine "<head>"
.WriteLine "<!--[if gte mso 9]><xml>"
.WriteLine "<x:ExcelWorkbook>"
.WriteLine "<x:ExcelWorksheets>"
.WriteLine "<x:ExcelWorksheet>"
'the following line names the tab (you can make multiple tabs/sheets)
.WriteLine "<x:Name>Items Over 3 Days Old</x:Name>"
.WriteLine "<x:WorksheetOptions>"
.WriteLine "<x

ageSetup>"
'the following line writes the header for the worksheet
.WriteLine "<x:Header>BRTT Active Requests Over 3 Days Old</x:Header>"
.WriteLine "</x

ageSetup>"
.WriteLine "<x

rint>"
.WriteLine "<x:ValidPrinterInfo/>"
.WriteLine "</x

rint>"
.WriteLine "</x:WorksheetOptions>"
.WriteLine "</x:ExcelWorksheet>"
.WriteLine "</x:ExcelWorksheets>"
.WriteLine "</x:ExcelWorkbook>"
.WriteLine "</xml>"
.WriteLine "<![endif]--> "
.WriteLine "</head>"
'the following line writes the table to excel
.WriteLine strOut
end with
act.close
end if 'recCount > 0'
end if
Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048
Tek-Tips Best Practices: FAQ183-3179