Hi Guys,
I am trying to open an excel sheet on an ASP page using the using the following code given below. but it looks like on some machines the File System object is getting created and on some machines not. On some systems the excel sheet opens and on other it doesn't open, instead it throws a http 500 error. Can you please tell me why this is happening.
Regards,
Madhuri
SET rsQuery = objconn.execute(strSqlQuery1)
if not rsQuery.EOF then
set fso = createobject("scripting.filesystemobject")
' create the text (xls) file to the server adding the -mmddyyyy after the g_title value
Set act = fso.CreateTextFile(server.mappath(""&g_filename & "-"& month(date())& day(date())& year(date()) &".xls"), true)
strLine="" 'Initialize the variable for storing the filednames
For each x in rsQuery.fields
strLine= strLine & x.name & chr(9)
Next
act.writeline strLine
Do while Not rsQuery.EOF
strLine=""
for each x in rsQuery.Fields
strLine= strLine & x.value & chr(9)
next
act.writeline strLine
rsQuery.MoveNext
Loop
' close the document
act.close
set rsQuery= Nothing
else
response.redirect("Sorry.asp")
end if