1

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,

generating Excel file error

thanks in advance, George

3
  • 1
    Which application are you trying to create the Excel object within? Have you set the correct reference in your project? Commented Sep 1, 2009 at 11:03
  • What do you mean application? I am confused. I just execute VBA. Commented Sep 1, 2009 at 11:15
  • I run it in classic ASP. Is that what information you need? Commented Sep 1, 2009 at 11:31

2 Answers 2

2

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>
Sign up to request clarification or add additional context in comments.

5 Comments

Thanks, but what is the solution to my issue? I have to use Excep in ASP.
I really need to access Excel object to generate Excel file for download, any ideas?
I have added a few notes. You will find more on this subject on StackOverflow and elsewhere.
Thanks Remou, I have looked through your recommended documents and they are really good. Since I am maintaining a legacy application and just install it on a new computer. I think your solution is optimum, but dues to limited time and resources, what I want to solve is why there is such error information, and how to properly change security settings to make it work. Any ideas why there is such security error messages?
Here is a related question, appreciate if you could take a look. :-)
0

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:

  1. open Dcomcnfg.exe

  2. open Component Services > My computer > DCOM Config

  3. Search for {00024500-0000-0000-C000-000000000046}

  4. right click properties > go to the Security tab

  5. under launch/activation permissions, click customise and edit

  6. make sure Admins, interactive, service and system are already added (local launch/act only)

  7. its classic ASP (on IIS 5 or 6 i assume) so try machine IUSR and IWAM accounts intially.

  8. 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).

  9. click ok/ok/ok.

  10. restart IIS/app pool.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.