It should on the server side. The problem is I dont know how. Could you help me on this one?
I'm new in web programming that why I dont know whats the best approach to do. I thought it would be the same as vb6 and MS Access VBA because i was able to this using vb6 and MS access.
Thanks guys for your replies!!!!
The actual error message is also posted below.
Dim oExcel As Excel.Application
Dim oBook As Excel.Workbook
Dim oSheet As Excel.Sheets
oExcel = New Excel.Application '''''''' the error is on this line.'''''
oExcel.Workbooks.Open("D:\excelupload.xls", )
oSheet = oBook.Worksheets(1)
oSheet("A1").Value = "test"
oSheet("B1").Value = "only"
oSheet("A1:B1").Font.Bold = True
oSheet("A2").Value = "test 2"
oSheet("B2").Value = "test 3"
The error is:
Server Error in '/test' Application.
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.
Source Error:
Line 42: Dim oSheet As Excel.Sheets
Line 43:
Line 44: oExcel = New Excel.Application
Line 45: oExcel.Workbooks.Open("D:\template.xls", )
Line 46: oBook = oExcel.Worksheets(1)
Source File: C:\Inetpub\wwwroot\test\excelupload.aspx.vb Line: 44
Stack Trace:
[UnauthorizedAccessException: Access is denied.]
test.excelupload.btnCreateEXCEL_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\test\exceluploading.aspx.vb:44
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.R aisePostBackEvent(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.1.4322.573; ASP.NET Version:1.1.4322.573