473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ASP.NET Excel Automation, Access is denied error

I'm running the following code on asp.net form

Dim objExcel As Excel.Application
Dim objWrkBk As excel.Workbook
objExcel = New excel.Application
objWrkBk = objExcel.Workbooks.Open("C:\Inetpub\wwwroot\ret\re t.xls")
objWrkBk.Close(SaveChanges:=True)
objWrkBk = Nothing
objExcel.Quit()
objExcel = Nothing

this runs fine on win forms but "Access is denied" error comes on
asp.net.

Is this impersonation problem, how to overcome?
I need this on asp.net, i have read
http://support.microsoft.com/defaul...b;en-us;Q257757 but then also i
have no other option.

thanks,
Shattar

Nov 21 '05 #1
2 5063
Hi,

I would not use excel to create an xls in a web project. Try this
method instead.

http://support.microsoft.com/default...b;en-us;319180

Ken
----------------
<aj*******@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I'm running the following code on asp.net form

Dim objExcel As Excel.Application
Dim objWrkBk As excel.Workbook
objExcel = New excel.Application
objWrkBk = objExcel.Workbooks.Open("C:\Inetpub\wwwroot\ret\re t.xls")
objWrkBk.Close(SaveChanges:=True)
objWrkBk = Nothing
objExcel.Quit()
objExcel = Nothing

this runs fine on win forms but "Access is denied" error comes on
asp.net.

Is this impersonation problem, how to overcome?
I need this on asp.net, i have read
http://support.microsoft.com/defaul...b;en-us;Q257757 but then also i
have no other option.

thanks,
Shattar

Nov 21 '05 #2
Thanks Ken,

i know it's not recommended. however consider this :

Client updates excel once a month which contain vba and formulaes.
Members inputs data which is exported into excel and then report is
generated from data imported from excel.

i can use odbc to input and extract data but unless i open excel and
save it, calculations do not take part, so this is the reason i have to
open save and close excel file.

if there is some other solution to fire calculations without using
automation pls. tell.

by-the-way i solved impersonation problem by registering aspnet user to
run excel application in dcom configuration.

regards,
Shattar

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jim | last post by:
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...
17
by: Ange T | last post by:
Hi there, I'm having pain with the VB behind an Access form. The form is used to create reports in Excel based on the details entered in the form. This has always worked without error on my...
0
by: Jon Rista | last post by:
Hello. I'm trying to automate Excel in a C# Windows Service. This windows service has to be able to access files on network shares, so it uses a domain account on a WinNT 4.0 domain server, rather...
4
by: Randy | last post by:
Hello, I'm getting an "Access Denied" error when I hit the line of code... Excel.Application oXL = new Excel.Application(); From what I've read, you can get around this by putting the file...
5
by: RoboSchro | last post by:
I'm building a reporting system in asp.net which needs an "export to Excel" function. We have Excel 2000 in the office. So I've added a reference to the Microsoft Excel 9.0 Object Library. Having...
9
by: hari krishna | last post by:
hi, I want to send the data from dataset information to Excel through ASP.Net. there will be no XL installed on web server. web server is win 2000 server machine. I am using visual basic code in...
8
by: jack | last post by:
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...
12
by: D. Shane Fowlkes | last post by:
This most likely belongs in another forum but I thought I'd start here. I have a COM Object written in VB6. The DLL will access MS Excel and use it's Object Library to write a customized report...
2
by: kelvinweb | last post by:
Hi All, I don't why alert below error message when I am using "Excel Application". I have to following the instruction, but the error is still here. Please help .. Dim excelApp As New...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.