How to use ASP & Config excel (Excel.Application) This is learn/tutorial asp developers how to using ASP and Config COM Excel (Excel.Applciation)
ShotDev Focus:
- ASP & Config Excel.Application
Solution
Server object, ASP 0178 (0×80070005)
The call to Server.CreateObject failed while checking permissions. Access is denied to this object.
/myasp/asp_connect_excel.asp, line 9
or Windows 2003 Server
Server object error ‘ASP 0177 : 800401f3′
Server.CreateObject Failed
/myasp/asp_connect_excel.asp, line 9
Solve Problem
Goto Control Panel -> Administrative Tools -> Event Viewer
Click Event Viewer
User IUSR_WEERACHAI error.
Open Component Services
Click DCOM Config
Right Click Microsoft Excel Application -> Properties
On tab Security Click Edit
Click Add
Click Advanced..
Add New user IUSR_Machine-name และ IWAM_Machine-name
Click OK
and Select All Allow
Click OK.
.
.
Example
asp_connect_excel.asp
<%Option Explicit%> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <% Dim xlApp Set xlApp = Server.CreateObject("Excel.Application") If IsObject(xlApp) Then Response.write("Connect to Excel.Application") Else Response.write("Cannot Connect to Excel.Application") End IF %> </body> </html>
Create a asp file and save to path root-path/myasp/
Run
http://localhost/myasp/asp_connect_excel.asp
Screenshot