473,666 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
+ 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...Especial ly 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 1473
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

"Rashrashet ta" <ra*********@ho tmail.com> wrote in message
news:6c******** *************** ***@posting.goo gle.com...
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...Especial ly 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.co m 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@donotsp am dowhileloop.com > wrote in message
news:uQ******** ******@TK2MSFTN GP10.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

"Rashrashet ta" <ra*********@ho tmail.com> wrote in message
news:6c******** *************** ***@posting.goo gle.com...
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...Especial ly 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
1861
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+). I'm displaying 9 columns in a datagrid, and have a radiobutton at the top of the page that says Web, Excel & Word. Web is selected by default. If you click one of the other two buttons, this code is executed: Private Sub...
12
2415
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 and saves it to a folder. The DLL even writes to a log for each step it takes so we can troubleshoot the problems (if any). This works fine on one machine but not another. The folder the DLL is trying to write to has full permissions assigned...
2
5502
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 the COM section to: Microsoft ActiveX Data Objects 2.7 Library Microsoft ActiveX Plugin Microsoft Excel 10.0 Object Library Microsoft Office XP Web Components
2
1131
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 input. Thanks. -- Paul G Software engineer.
2
3153
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 way, the new system that I am programming will need to be feeded daily with an excel file. So I need to read a given file and write it to the database - hopefully they all will follow the same structure. My issue is I haven't found anything...
1
1343
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 happens to be within a certain range, I need the program to call different sub routines. I know how to call the subroutines, but I'm haing trouble reading the Excel values in realtime. I appreciate your time and help regarding the matter. Thanks...
2
2883
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... : Excel.Application excelObj = new Excel.Application(); Excel.Workbook theWorkbook = excelObj.Workbooks.Open(path+filename, 0, true, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false,
2
3937
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 updated on the website dynamically. If it is possible to do it by writing a few lines of codes into the php file to make it read the data in the xls into the web page, how can it be done? If not, what would be the best way to do it?
1
2429
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 dialog box appears that says "There was an error opening the file". when i try to open the excel files, a dialog box appears that says "File format not valid". I have tried to create a new word and excel files, save them and when i try to open these...
4
2248
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 size = 1 session = W_MAIN QuoteBlockTiming exceeded 1000 ms: 1640 --- Fri Nov 06 06:09:18 CST 2009 170.137.94.2 Class key = 649126749 block size = 1 session = W_MAIN QuoteBlockTiming exceeded 1000 ms: 1146 --- Fri Nov 06 06:28:25 CST 2009 170.137.88.2...
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8550
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8638
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7381
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5662
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4193
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4365
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2006
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1769
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.