K
KLomax
I am trying to use an excel spreedsheet on an asp.net page.
The follow code works (with output mod.) in a .net console
application. When I try to run this code in asp.net,
the "dim new excel app" statement fails
with "System.UnauthorizedAccessException: Access is
denied."
Are there some security settings I need to tweek to
instantiate an Excel object in VB.NET ?
Any ideas would be appreciated.
Regards,
KLomax
Try
Dim objExcel As New Excel.Application()
objExcel.Workbooks.Open("C:\TEMP\TestExcel.xls")
Label1.Text = _
objExcel.ActiveSheet.Cells(1,1).Value.ToString
objExcel.Workbooks.Close()
Catch exp As Exception
Label1.Text = exp.ToString
End Try
The follow code works (with output mod.) in a .net console
application. When I try to run this code in asp.net,
the "dim new excel app" statement fails
with "System.UnauthorizedAccessException: Access is
denied."
Are there some security settings I need to tweek to
instantiate an Excel object in VB.NET ?
Any ideas would be appreciated.
Regards,
KLomax
Try
Dim objExcel As New Excel.Application()
objExcel.Workbooks.Open("C:\TEMP\TestExcel.xls")
Label1.Text = _
objExcel.ActiveSheet.Cells(1,1).Value.ToString
objExcel.Workbooks.Close()
Catch exp As Exception
Label1.Text = exp.ToString
End Try