Reputation: 45771
I am using the following code to create Excel object using VBA. I am using Office 2003. I run the following code in classic ASP.
Set myexcel = CreateObject("Excel.Application")
Error message is, any permission needed to create Excel object?
Computer - default permission settings do not permit the address LocalHost (using LRPC) using the CLSID {00024500-0000-0000-C000-000000000046}
EDIT1:
I have a related question here, appreciate if anyone could take a look,
thanks in advance, George
Upvotes: 1
Views: 995
Reputation: 3061
If you want to get it to work, as opposed to implementing a more elegant solution.
==================== Workaround:
Its a security vunerability (but you said you must just get it to work)... however, have you tried adding the IUSR and IWAM accounts to the local activation and launch permissions for the COM+ application in question?
steps:
open Dcomcnfg.exe
open Component Services > My computer > DCOM Config
Search for {00024500-0000-0000-C000-000000000046}
right click properties > go to the Security tab
under launch/activation permissions, click customise and edit
make sure Admins, interactive, service and system are already added (local launch/act only)
its classic ASP (on IIS 5 or 6 i assume) so try machine IUSR and IWAM accounts intially.
If adding these doesn't work (local act and launch), if you have app pools try adding the account used for the application pool also (lookup the identity tab of the app pool).
click ok/ok/ok.
Upvotes: 0
Reputation: 91356
This article may be of interest, it says:
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
You may wish to look at mime types and How to output an Excel *.xls file from classic ASP
Very, very roughly:
<%
Response.ContentType = "application/vnd.ms-excel"
%>
<TABLE>
<TR>
<TD>
<!-- Cell : A1 -->
2
</TD>
</TR>
<TR>
<TD>
<!-- Cell : A2 -->
3
</TD>
</TR>
<TR>
<TD>
<!-- Cell : A3 -->
=SUM(A1:A2)
</TD>
</TR>
</TABLE>
Upvotes: 2