S
Stu
Hi,
I am trying to open a word document from an asp.net page but I keep getting
an access denied error when I try to create an instance of the word
applications.
I have created references to the Office 11.0 Object and it imported the
other references (except stdole which I did manually)
I have imported namepsaces:
Imports System.ComponentModel
Imports Microsoft.Office.Interop
The code I am calling is:
Dim oWordApp As Word.Application
Dim oWordDoc As Word.Document
oWordApp = New Word.Application '<<<<<<<<<<<<<<<<< ERROR
oWordDoc = oWordApp.Documents.Open("c:\text.doc")
The error below says I should give access permission to the ASPNET user. But
a) that user does not exist on my machine - I think it is 'Authenticated
user' that I need and b) which file needs to be given permission?!? I have
tried giving this user full control over the entire Office folder (not
something I'd do on a production server), but no go!
Does anyone know which file needs permission? Any other suggestions?
Thanks in advance,
Stuart
====================================================================
The error:
Access is denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access is denied.
ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request identity.
ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or
Network Service on IIS 6) that is used if the application is not
impersonating. If the application is impersonating via <identity
impersonate="true"/>, the identity will be the anonymous user (typically
IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET write access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add the
appropriate user or group. Highlight the ASP.NET account, and check the
boxes for the desired access.
I am trying to open a word document from an asp.net page but I keep getting
an access denied error when I try to create an instance of the word
applications.
I have created references to the Office 11.0 Object and it imported the
other references (except stdole which I did manually)
I have imported namepsaces:
Imports System.ComponentModel
Imports Microsoft.Office.Interop
The code I am calling is:
Dim oWordApp As Word.Application
Dim oWordDoc As Word.Document
oWordApp = New Word.Application '<<<<<<<<<<<<<<<<< ERROR
oWordDoc = oWordApp.Documents.Open("c:\text.doc")
The error below says I should give access permission to the ASPNET user. But
a) that user does not exist on my machine - I think it is 'Authenticated
user' that I need and b) which file needs to be given permission?!? I have
tried giving this user full control over the entire Office folder (not
something I'd do on a production server), but no go!
Does anyone know which file needs permission? Any other suggestions?
Thanks in advance,
Stuart
====================================================================
The error:
Access is denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access is denied.
ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request identity.
ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or
Network Service on IIS 6) that is used if the application is not
impersonating. If the application is impersonating via <identity
impersonate="true"/>, the identity will be the anonymous user (typically
IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET write access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add the
appropriate user or group. Highlight the ASP.NET account, and check the
boxes for the desired access.