web 2.0

How to use ASP & Config excel (Excel.Application)

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

ASP & Config excel (Excel.Application)

Click Event Viewer

ASP & Config excel (Excel.Application)

User IUSR_WEERACHAI error.

ASP & Config excel (Excel.Application)

Open Component Services

ASP & Config excel (Excel.Application)

Click DCOM Config

ASP & Config excel (Excel.Application)

Right Click Microsoft Excel Application -> Properties

ASP & Config excel (Excel.Application)

On tab Security Click Edit

ASP & Config excel (Excel.Application)

Click Add

ASP & Config excel (Excel.Application)

Click Advanced..

ASP & Config excel (Excel.Application)

Add New user IUSR_Machine-name และ IWAM_Machine-name

ASP & Config excel (Excel.Application)

Click OK

ASP & Config excel (Excel.Application)

and Select All Allow

ASP & Config excel (Excel.Application)

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

ASP & Config excel (Excel.Application)

.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (4 votes, average: 3.25 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.