Can't instantiate Excel app object in ASP.net app (permissions issue)

  • Thread starter Thread starter Ronald S. Cook
  • Start date Start date
R

Ronald S. Cook

The following line in my ASP.NET 2.0 app will not execute because of a
permissions issue.

Excel.Application objApplication = new Excel.Application();

How/where do I make the setting to allow this?



Thanks,

Ron
 
Ron,
Have you set the aspCompat="true" in your @Page declaration? This is
required to do COM Interop in an ASP.NET page. What is the exact exception
you are getting?
Peter
 
Peter,

This attribute is for in-proc native COM servers only, here the server is an
out-proc server application, so this is not applicable and not the OP's
issue euither.

Willy.

| Ron,
| Have you set the aspCompat="true" in your @Page declaration? This is
| required to do COM Interop in an ASP.NET page. What is the exact exception
| you are getting?
| Peter
|
| --
| Co-founder, Eggheadcafe.com developer portal:
| http://www.eggheadcafe.com
| UnBlog:
| http://petesbloggerama.blogspot.com
|
|
|
|
| "Ronald S. Cook" wrote:
|
| > The following line in my ASP.NET 2.0 app will not execute because of a
| > permissions issue.
| >
| > Excel.Application objApplication = new Excel.Application();
| >
| > How/where do I make the setting to allow this?
| >
| >
| >
| > Thanks,
| >
| > Ron
| >
| >
| >
 
| The following line in my ASP.NET 2.0 app will not execute because of a
| permissions issue.
|
| Excel.Application objApplication = new Excel.Application();
|
| How/where do I make the setting to allow this?
|
|
|
| Thanks,
|
| Ron
|
|

You have to grant the asp.net user (the user under witch asp.net runs)
"launch" and "access" permissions for excel (run dcomncfg), by default this
user is "aspnet" or "network service" depending on the type of OS (XP/W2K or
W2K3).
Note also that excel (like all other office applications) aren't designed to
run from asp or any other server like application, and it's not supported
either. Be prepared to encounter a lot of problems.

Willy.
 
http://support.microsoft.com/default.aspx?kbid=257757
MS does not recommend server side automation of office.
And for writing to Excel the following link:
http://www.eggheadcafe.com/articles/20021012.asp

Ronald S. Cook said:
The following line in my ASP.NET 2.0 app will not execute because of a
permissions issue.

Excel.Application objApplication = new Excel.Application();

How/where do I make the setting to allow this?

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top