Hi, I am facing problem in ASP application where I am getting error message
"Server object, ASP 0178 (0x80070005)
The call to Server.CreateObject failed while checking permissions. Access is denied to this object." on
Set MyExcelApp = Server.CreateObject("Excel.Application")
i have learnt that calling Excel.Application on web server is not a good practice so
I am using the following method
Response.ContentType = "application/vnd.ms-excel"
'Response.AddHeader "Content-Disposition","attachment;filename=Tool_Report(Date ).xls"
i am able to generate and download Excel Sheet from the above method but my problem is how can I dynamically create Excel Charts with the Sheet that i have generated. I urgently need the solution please guide me
Here is the Code that i have written,
session.lcid=2057
dim Cn,Rs,strFromDate,strToDate,strQuery
strFromDate = Cstr ( FormatDateTime(cDate(Request.Form("txtStartDate")) ,2) )
strToDate = Cstr ( FormatDateTime(cDate(Request.Form("txtEndDate")),2 ) )
strQuery= ""
strQuery = "select * from tool_candidate,tool_master where tool_master.tool_id=tool_candidate.tool_id and tool_master.tool_Date >='" & strFromDate & "' and tool_Date<='" & strToDate & "'"
set Cn=server.createobject("ADODB.connection")
set Rs=server.createobject("ADODB.recordset")
Cn.open "provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("tool.mdb")
Rs.open strQuery,Cn,1,3
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment; filename=Tool_Report(Date).xls"
if Rs.eof <> true then
Response.Write("<Table Border='1'>")
while not Rs.eof
'response.write "<tr><td>" & Rs.fields(0) & "</td><td>" & Rs.fields(1) & "</td><td>" & Rs.fields(2) & "</td><td>" &Rs.fields(3) & "</td><td>" & Rs.fields(4) & "</td><td>" & Rs.fields(5) & "</td></tr>"
Rs.movenext
i = i + 1
wend
response.write "</table>"
end if
set rs=nothing
Cn.close
Thanks & Regards
Rohit