I'm trying to automate Excel from within an ASP.NET application. I
downloaded and installed the Primary Interop Assemblies, because I'm using
Office XP. I then set a reference to the Microsoft Excel Object 10.0
Library in my project. I then wrote the following code:
Excel.Application xl = new Excel.ApplicationClass(); //Error occurs here
xl.get_Range("A2","A2").CopyFromRecordset(
l_dsetActivity.Tables[0],
l_dsetActivity.Tables[0].Rows.Count,
l_dsetActivity.Tables[0].Columns.Count);
xl.Save(l_sPath);
xl.Quit();
xl = null;
System.Runtime.InteropServices.Marshal.ReleaseComO bject(xl);
When I go to this page, however, I get the error: Access Denied. It tells
me that ASP.NET is not authorized to access the requested resource. but I'm
not sure which resource should be authorized/given permissions. Can anybody
help with this?
Thanks, Jim