473,574 Members | 5,884 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Applicati on objApplication = new Excel.Applicati on();

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

Thanks,

Ron
Feb 15 '06 #1
7 1415
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.Applicati on objApplication = new Excel.Applicati on();

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*******@yaho o.nospammin.com > wrote in message
news:50******** *************** ***********@mic rosoft.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.Applicati on objApplication = new Excel.Applicati on();
| >
| > 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******** ********@TK2MSF TNGP09.phx.gbl. ..
| The following line in my ASP.NET 2.0 app will not execute because of a
| permissions issue.
|
| Excel.Applicati on objApplication = new Excel.Applicati on();
|
| 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*******@yaho o.nospammin.com > wrote in message
news:50******** *************** ***********@mic rosoft.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.Applicati on objApplication = new Excel.Applicati on();
| >
| > 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.Applicati on objApplication = new Excel.Applicati on();

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3778
by: A frustrated developer | last post by:
The following article discussed how to use the Excel, close and kill it: http://support.microsoft.com/default.aspx?scid=kb;en-us;317109 But if you added a oBook.SaveAs(...) to save the workbook in the code, it never worked for me. We use Excel 2003 and Visual Studio 2003 under Windows XP. We don't have problem to kill Excel instance under...
1
1510
by: Marc Miller | last post by:
I have a vbscript in an .asp page that issues the following: Set xlApp = CreateObject("Excel.Application") When I run my page, I get the error: ActiveX Component can't create object: 'Excel Application' However, I can use the same type of syntax in Visual Foxpro and instantiate the object (o=CreateObject("Excel.Application"). I have...
7
1987
by: J-T | last post by:
I can instantiate my object in my *ASP.NET* application in two ways: A) public sealed class RSSingleton { private static ReportingServiceProxy m_RsProxy=null; static RSSingleton() { m_RsProxy = new ReportingServiceProxy();
0
1082
by: tg | last post by:
I cannot figure out what resource to which to give ASPNET permissions. I've tried everything I can think of. Any ideas? (Error message and snippet below) --------- Server Error in '/LDAP-Windchill Compare' Application. Access is denied. Description: An unhandled exception occurred during the execution of the current web request. Please...
4
1759
by: Mr.Doubt | last post by:
I've a widows application, that makes use of an EXCEL COM object, to run a few macros available in a EXCEL file. The object is created when the app is started and is closed when the app is closed. The app also has a OLEDB connection to the same file to fetch data from the file and display it on a datagrid. Now my trouble is that, when I...
8
38163
by: SteveS | last post by:
I'm attempting to close EXCEL from within my VB.NET application. Using the excel object library to write data to my spreadsheet is working fine but when I try to quit application object it does not work. I know this because I can still see the Excel application running in Task Manager. How do I shut down EXCEL? -- Thank You
1
1498
by: Keith McDonald | last post by:
We have executable program that is used to create and send emails to users. Working on getting it able to be called from a web page we're having some problems. First of all if debugging the website from local it returns the common JIT debugger failure, access denied after the Process.Start() call. Access denied for machine\ASPNET. Haven't...
4
3657
by: Tomas | last post by:
A newbie question: How can I instantiate objects dynamically in VB.NET. E.g. I have the object 'Player' and I would like to instantiate it with the several instances (James, Gunner, etc.), without in advance knowing how many objects (employee1, employee2, etc) Dim player1 As New Persons.Players Dim player2 As New Persons.Players Dim...
1
1374
by: Scott M. | last post by:
Many methods return objects when they are called. With Excel these objects are placed in memory and must be destroyed via ReleaseComObject as you have done with your NAR method, but the line: objExcel.Workbooks.Open(Page.MapPath("reports\BLCost.xls")) could be the culprit since the Open method returns a reference to a Workbook object that...
0
7826
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7741
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8259
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7838
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8126
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6491
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5328
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3781
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2257
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.