473,471 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

HELP...C# reading from Excel in a web-from prob...

Hai all,

I am trying to read and write to an excel sheet using C# in a
webform...
I'v read alot of tutorials and used it...it works BUT ONLY
ONCE...Especially when writing to the sheet...
I mean when I want to read its fine....
But when I write to the sheet...first time it does...but after I open
it ( to see the result manually )...close it...and try to write again,
it gives me an error ( configuration error ) and says "Access
denied"....
Whats the problem ?? please tell me....

I am saving the excel sheet in the (wwwroot)folder...is this a
reason??

By the way I am using the regular way to read and write ..I mean by
defining an excel application and then go to a specified range ( not
via oledb object )....

I have another question: If I desire to go to the last row in the
sheet...How can I do so???

Thanx alot,
Rashrashetta
Nov 17 '05 #1
2 1467
don't try to open it manually after the first time you write to it. See if
it will write to it the second time. Do you have the excel sheet open while
you are trying to write to it? If I am not wrong, all office products apply
file locking when you open them.

--
info@donotspam dowhileloop.com
http://www.dowhileloop.com web development
http://publicjoe.dowhileloop.com -- C# Tutorials

"Rashrashetta" <ra*********@hotmail.com> wrote in message
news:6c**************************@posting.google.c om...
Hai all,

I am trying to read and write to an excel sheet using C# in a
webform...
I'v read alot of tutorials and used it...it works BUT ONLY
ONCE...Especially when writing to the sheet...
I mean when I want to read its fine....
But when I write to the sheet...first time it does...but after I open
it ( to see the result manually )...close it...and try to write again,
it gives me an error ( configuration error ) and says "Access
denied"....
Whats the problem ?? please tell me....

I am saving the excel sheet in the (wwwroot)folder...is this a
reason??

By the way I am using the regular way to read and write ..I mean by
defining an excel application and then go to a specified range ( not
via oledb object )....

I have another question: If I desire to go to the last row in the
sheet...How can I do so???

Thanx alot,
Rashrashetta

Nov 17 '05 #2
in addition, you can make use of the filemon tool from sysinternals.com to
find out which process has the lock on the excel file.

--
Regards
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
--------------------------------------------------
"Landi" <info@donotspam dowhileloop.com> wrote in message
news:uQ**************@TK2MSFTNGP10.phx.gbl...
don't try to open it manually after the first time you write to it. See
if
it will write to it the second time. Do you have the excel sheet open
while
you are trying to write to it? If I am not wrong, all office products
apply
file locking when you open them.

--
info@donotspam dowhileloop.com
http://www.dowhileloop.com web development
http://publicjoe.dowhileloop.com -- C# Tutorials

"Rashrashetta" <ra*********@hotmail.com> wrote in message
news:6c**************************@posting.google.c om...
Hai all,

I am trying to read and write to an excel sheet using C# in a
webform...
I'v read alot of tutorials and used it...it works BUT ONLY
ONCE...Especially when writing to the sheet...
I mean when I want to read its fine....
But when I write to the sheet...first time it does...but after I open
it ( to see the result manually )...close it...and try to write again,
it gives me an error ( configuration error ) and says "Access
denied"....
Whats the problem ?? please tell me....

I am saving the excel sheet in the (wwwroot)folder...is this a
reason??

By the way I am using the regular way to read and write ..I mean by
defining an excel application and then go to a specified range ( not
via oledb object )....

I have another question: If I desire to go to the last row in the
sheet...How can I do so???

Thanx alot,
Rashrashetta


Nov 17 '05 #3

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

Similar topics

0
by: Steve Chatham | last post by:
I am stuck on this. It ought to be a simple reason as to why this is problematic, in that it works on smaller groups of data (say under 40 records), but doesn't on larger groups of records (40+)....
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: Business Information Systems, Inc. | last post by:
I keep receiving the following error when I try to access Office XP Excel through VB.Net on a web form. I have loaded and registered the Microsoft Office XP PIAs. I have added a reference in...
2
by: Paul | last post by:
Hi just wondering if anyone has tried to read in an excel file into a web application? I have a web app that I want to be able to update records in an mssql database and use an excel file for data...
2
by: Reza Solouki | last post by:
Hello, I never had to do anything with office tools programmatically till now(I guess there is first time for everything), so this might be a very silly and simple question for some of you. Any...
1
by: maverick7983 | last post by:
Hi, I am engineering student at Rutgers University, I need help in writting a VB.Net program which will read voltage values logged in Excel by a Data Acquisition Card and if the voltage value...
2
by: sherifffruitfly | last post by:
Hi, I'm using an adaptation of excel-reading code that's all over the internet - I don't much like or understand it, but it has worked for me in the past.... beggars can't be choosers... : ...
2
by: i.arda.tezcan | last post by:
Hello, I'm trying to make a web page that will read the xls file and make a table out of it on the web page. I want to change the excel file from time to time and I want the changes to be...
1
navanova
by: navanova | last post by:
Greetings, I have a problem of opening ms word and excel files on my computer. The files are there for a long time. I use to open and modify them. Suddenly, when i try to open the word files, a...
4
by: ndedhia1 | last post by:
I am reading in a file to see what delays I am getting on what IP address: QuoteBlockTiming exceeded 1000 ms: 1684 --- Fri Nov 06 06:09:10 CST 2009 170.137.94.95 Class key = 649126730 block...
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.