By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,536 Members | 2,165 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,536 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.