Lighthouse325
asked on
Export data from ASP.Net to EXCEL 2010, do we need local administrator credential to run?
Hello experts!
My team has been developing an intranet application in ASP.Net, with Excel 2010 installed on the application server. Only local administrators can download the Excel file. Users, remote desktop users are asked to login. To automate that, we are considering iimpersonation in ASP.Net, but do we need local admin? And why?
Thank you,
KS
My team has been developing an intranet application in ASP.Net, with Excel 2010 installed on the application server. Only local administrators can download the Excel file. Users, remote desktop users are asked to login. To automate that, we are considering iimpersonation in ASP.Net, but do we need local admin? And why?
Thank you,
KS
ASKER
Thank you for reply raqi0017.
However, remote users can't run EXCEL on the application server.
The system only allows local admin for the access, but we don't want to give them the credential.
Possible solutions we found are;
1. Grant local admin "Network Service"
2. Impersonate as local admin.
My question is why do we need local admin to run EXCEL.
And is there better solution?
Thanks,
KS
However, remote users can't run EXCEL on the application server.
The system only allows local admin for the access, but we don't want to give them the credential.
Possible solutions we found are;
1. Grant local admin "Network Service"
2. Impersonate as local admin.
My question is why do we need local admin to run EXCEL.
And is there better solution?
Thanks,
KS
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
raqi0017,
We are going for the impersonation.
We tested with EXCEL2010 and got errors where adding books.
Windows server 2003
Visual studio 2005
Language: VB.Net
Program code
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ------- Dim objExcel As New Excel.Application
Dim objBooks As Excel.Workbooks = objExcel.Workbooks
'Open new excel book
Dim objBook As Excel.Workbook = objBooks.Add <-- getting an error
Dim objSheets As Excel.Worksheet = objBook.Sheets("Sheet1")
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- -------
So far, to work around this error, impersonating accout needs to be an administrator.
Appreciate your help!!
KS
We are going for the impersonation.
We tested with EXCEL2010 and got errors where adding books.
Windows server 2003
Visual studio 2005
Language: VB.Net
Program code
--------------------------
Dim objBooks As Excel.Workbooks = objExcel.Workbooks
'Open new excel book
Dim objBook As Excel.Workbook = objBooks.Add <-- getting an error
Dim objSheets As Excel.Worksheet = objBook.Sheets("Sheet1")
--------------------------
So far, to work around this error, impersonating accout needs to be an administrator.
Appreciate your help!!
KS
what is the exception thats coming
can ou please provide some details
can ou please provide some details
ASKER
Here is the exception;
Exception from HRESULT: 0x800A03EC
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.Runtime.InteropServ ices.COMEx ception: Exception from HRESULT: 0x800A03EC
Source Error:
Line 601: 'Dim objBooks As Excel.Workbooks = objExcel.Workbooks.Add(Tru e)
Line 602: 'Open new excel book
Line 603: Dim objBook As Excel.Workbook = objExcel.Workbooks.Add
Line 604:
Line 605: Dim objSheets As Excel.Worksheet = objBook.Sheets("Sheet1")
Thanks,
KS
Exception from HRESULT: 0x800A03EC
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.Runtime.InteropServ
Source Error:
Line 601: 'Dim objBooks As Excel.Workbooks = objExcel.Workbooks.Add(Tru
Line 602: 'Open new excel book
Line 603: Dim objBook As Excel.Workbook = objExcel.Workbooks.Add
Line 604:
Line 605: Dim objSheets As Excel.Worksheet = objBook.Sheets("Sheet1")
Thanks,
KS
ASKER
Thank you for the advicem, raqi0017. Although we could never configure without assign the impersonating account as local admin, it basically solve it.
Admin is a big permission and to save a file its just a folder access and that should solve your problem at hand