471,354 Members | 1,187 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

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

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
Feb 15 '06 #1
7 1339
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

Feb 15 '06 #2
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.

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:50**********************************@microsof t.com...
| 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
| >
| >
| >
Feb 15 '06 #3

"Ronald S. Cook" <rc***@westinis.com> wrote in message
news:OK****************@TK2MSFTNGP09.phx.gbl...
| 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.


Feb 15 '06 #4
Willy,
Thanks I stand corrected.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Willy Denoyette [MVP]" wrote:
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.

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:50**********************************@microsof t.com...
| 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
| >
| >
| >

Feb 15 '06 #5
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" 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?


--
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
Feb 15 '06 #6
Peter, didn't you write about this topic over there
http://www.eggheadcafe.com/articles/20021012.asp

;))
"Peter Bromberg [C# MVP]" wrote:
Willy,
Thanks I stand corrected.
Peter


--
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
Feb 15 '06 #7
Yes thanks for reminding me, but as you know there are so many variables
involved with Excel. Seems like everybody wants to do it, and as Willy so
astutely points out, it is almost never a good idea.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Michael Nemtsev" wrote:
Peter, didn't you write about this topic over there
http://www.eggheadcafe.com/articles/20021012.asp

;))
"Peter Bromberg [C# MVP]" wrote:
Willy,
Thanks I stand corrected.
Peter


--
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

Feb 16 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by A frustrated developer | last post: by
1 post views Thread by Marc Miller | last post: by
7 posts views Thread by J-T | last post: by
reply views Thread by tg | last post: by
4 posts views Thread by Mr.Doubt | last post: by
8 posts views Thread by SteveS | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.