473,769 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

office automation securiy error

Hi. While trying to create a a word document in one of my asp.net pages I
keep getting an ASP.NET permission error. first I thought it was been caused
while trying to save the document, and I added permissions for the ASP.NET
account to my folders. after that I realized that the error was being
launche at the very first line of my function:

Word.Applicatio nClass WordApp = new Word.Applicatio nClass();

any ideas on how to solve this?
Thanks a lot,
Alejandro.


Nov 19 '05 #1
3 1599
For those who need the answer visit this link:
http://www.codeproject.com/aspnet/wo...372#xx999372xx

"Alejandro Penate-Diaz" <al********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Hi. While trying to create a a word document in one of my asp.net pages I
keep getting an ASP.NET permission error. first I thought it was been
caused while trying to save the document, and I added permissions for the
ASP.NET account to my folders. after that I realized that the error was
being launche at the very first line of my function:

Word.Applicatio nClass WordApp = new Word.Applicatio nClass();

any ideas on how to solve this?
Thanks a lot,
Alejandro.

Nov 19 '05 #2
Not to be a nark or anything, but I think the licensing for office prohibits
this sort of usage on a webserver. Or, rather, you're supposed to have a
license for office for each user using your web application. At least this
is my understanding. I'd check the EULA.

BTW, this should be unrelated to the permission problem ;)

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi. While trying to create a a word document in one of my asp.net
pages I keep getting an ASP.NET permission error. first I thought it
was been caused while trying to save the document, and I added
permissions for the ASP.NET account to my folders. after that I
realized that the error was being launche at the very first line of my
function:

Word.Applicatio nClass WordApp = new Word.Applicatio nClass();

any ideas on how to solve this?
Thanks a lot,
Alejandro.


Nov 19 '05 #3
It's probably a security issue.
The ASPNET user account does have permission to run office by default.
You can use impersonation to have ASP.NET run under a different user account
that does have the necessary permission.

For example, you can add a line similar to this to your web.config file:
<identity impersonate="tr ue" userName="domai n\MyUserName">
password="passw ord"/>

Here's more info on impersonation:
http://msdn.microsoft.com/library/de...ersonation.asp

Here's more info on generating office documents, including the wrong ways
(like office automation) and the right ways:
http://SteveOrr.net/articles/ExcelExport.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Alejandro Penate-Diaz" <al********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Hi. While trying to create a a word document in one of my asp.net pages I
keep getting an ASP.NET permission error. first I thought it was been
caused while trying to save the document, and I added permissions for the
ASP.NET account to my folders. after that I realized that the error was
being launche at the very first line of my function:

Word.Applicatio nClass WordApp = new Word.Applicatio nClass();

any ideas on how to solve this?
Thanks a lot,
Alejandro.

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
6262
by: Richard | last post by:
Office Addins are easy in .NET. Try this from Visual Studio's main menu: File New Project "Other Projects" Extensibility Projects Shared Addin Run the wizard and you're off...
2
1836
by: Alex Maghen | last post by:
Hi. I've seen several KBs on using .NET for MS Office Automation. But I have a particular question: I am developing a somewhat stand-alone .ASPX page which will need to do some relatively simple MS Office Automation (Office 2003+). The .ASPX page is not part of a Web Forms Visual Studio project. It's just a stand-alone file. And therefore, there is not "References" setting or anything because there's no Visual Studio project. My...
0
946
by: Steven Thomas | last post by:
I have a windows service that uses office xp automation. Here is the code --------------------------------------- Public Sub CAccessSnapShot() Try Dim objAccess As New Access.Application() Dim vSQLText, vThreadName As String Try vThreadName = Thread.CurrentThread.Name cFunctions.WriteEventLog("starting report on thread: " &
0
1249
by: Marco Singer | last post by:
Hi all, I want to create an Office automation client for Office 97 (and newer) which should automate Access, Excel and Word. On my developer computer I have Office XP installed. In KB244167 (INFO: Writing Automation Clients for Multiple Office Versions) Microsoft tells to use the type libraries of the oldest office version the client should run with. So I copied the type library files from a Office 97 installed on another
2
2445
by: William LaMartin | last post by:
I have created a program that allows for the automation of things in Word documents, like changing the values of DocVariables and the links to Excel Sheets. I did it using interoperoperatability, where I declare objects as follows: Dim oWordApp As New Microsoft.Office.Interop.Word.Application, after adding a reference to Microsoft.Office.Core and a reference to Microsoft Word. I could do this since I have the Primary Interop...
2
11477
by: William LaMartin | last post by:
I have created a program that allows for the automation of things in Word documents, like changing the values of DocVariables and the links to Excel Sheets. I did it using interoperoperatability, where, after adding a reference to Microsoft.Office.Core and a reference to Microsoft Word I declare objects as follows: Dim oWordApp As New Microsoft.Office.Interop.Word.Application, . Everything works fine on the development computer...
6
1870
by: Luke Vogel | last post by:
Hi all ... could someone point me in the right direction for programming office applications (specifically excel) using vb.net? Can vb.net replace or enhance VBA that comes with the office suite? cheers... have a great Christmas all! -- Regards Luke. ----- There are 10 types of people in this world
1
1339
by: Alberto | last post by:
Hi all. I'd like to know if the "architect" version of Visual Studio .NET includes the environment to develop Office application. Any way is it possible to devolpo Office XP apps with VS .Net or I need some more componentes ? Thanks
12
1645
by: Tomas | last post by:
Hi, I have worked with VB.NET for half a year (semi-newbie). Currently I am looking around for some books for those that crossed the starting hurdle. There are too many books out there-make choosing, a bit of a gamble. If you have experience of good VB.NET books on general and office automattion, you could recommend, it would be greatly appreciated.
0
9579
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10208
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10038
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9987
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9857
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7404
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3952
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
3
2812
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.