Vraagje,
Ik ben een .net website aan het maken. Wanneer een gebruiker wat dingen invult start er server- side een object die via de Excel COM referentie een excel template gaan ombouwen. In een gewone console application gaat dat best, maar als ik dit in de webpage doe krijg ik telkens de volgende authorisatie melding:
Het lijkt dus fout te gaan bij het aanmaken van het Excel object. Maar nou heb ik de website read en write rechten gegeven. Nog steeds geen effect. Iemand enig idee?
Ik ben een .net website aan het maken. Wanneer een gebruiker wat dingen invult start er server- side een object die via de Excel COM referentie een excel template gaan ombouwen. In een gewone console application gaat dat best, maar als ik dit in de webpage doe krijg ik telkens de volgende authorisatie melding:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
| Server Error in '/FaktuurSite1' Application.
--------------------------------------------------------------------------------
Toegang geweigerd.
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: Toegang geweigerd.
The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited privileges. Consider granting access rights to the resource to the ASP.NET process identity.
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 "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the Write box in the Allow column.
Source Error:
Line 122: public ExcelWorkbookObject()
Line 123: {
Line 124: CurrentExcelApp = new Excel.ApplicationClass();
Line 125: CurrentWorkbooks = new System.Collections.ArrayList();
Line 126: }
Source File: c:\inetpub\wwwroot\faktuursite1\excelpower.cs Line: 124
Stack Trace:
[UnauthorizedAccessException: Toegang geweigerd.]
ExcelPower.ExcelWorkbookObject..ctor() in c:\inetpub\wwwroot\faktuursite1\excelpower.cs:124
ExcelPower.ExcelFactuur..ctor() in c:\inetpub\wwwroot\faktuursite1\excelpower.cs:30
FaktuurSite1.WebForm1.cmdMaakFaktuur_ServerClick(Object sender, EventArgs e) in c:\inetpub\wwwroot\faktuursite1\faktuurform.aspx.cs:78
System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e)
System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0 |
Het lijkt dus fout te gaan bij het aanmaken van het Excel object. Maar nou heb ik de website read en write rechten gegeven. Nog steeds geen effect. Iemand enig idee?