473,385 Members | 1,185 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,385 software developers and data experts.

Error:[COMException (0x800a03ec): Document not saved.]

hi

I am just a starter in programming.

i am trying to read and write data to Excel from asp.net

i am able to read a particular cell from my Excel sheet but i am not able to write and save into it.
any help would be appreciated..
thanks.

**************************My Code**********************

Dim MyExcel As Microsoft.Office.Interop.Excel.Application
Dim MyWorkbook As Microsoft.Office.Interop.Excel.Workbook
Dim MySheet As Microsoft.Office.Interop.Excel.Worksheet
Dim MyCell As Microsoft.Office.Interop.Excel.Range

MyExcel = New Microsoft.Office.Interop.Excel.Application
MyExcel.Workbooks.Open("C:\Inetpub\wwwroot\AddNewP romotion\Excel1.xls", , False)
MyWorkbook = MyExcel.Application.ActiveWorkbook
MySheet = MyWorkbook.ActiveSheet
Label1.Text() = MySheet.Cells.Item(1, 1).value

MySheet.Cells.Item(2, 2).value = "madhu"

MyExcel.ActiveWorkbook.SaveAs("C:\Inetpub\wwwroot\ AddNewPromotion\Excel2.xls")

MyExcel.ActiveWorkbook.Close()
MyExcel = Nothing
MyWorkbook = Nothing
MySheet = Nothing

**********************End************************* *********
Oct 25 '06 #1
1 4529
AricC
1,892 Expert 1GB
Try this out:
.Net + Excel
Or...
Some of these:
More
Oct 25 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: timtai | last post by:
I am trying to create an excel report from my aspx.vb code. I got the following error trying to add a workbook: Dim xApp As New Microsoft.Office.Interop.Excel.Application Dim xWB As...
4
by: david.kuczek | last post by:
I got the following error in a javascript I wrote. The script works fine, but why is the error being displayed??? ##### Here comes the little script: function...
6
by: linuxnooby | last post by:
Hi I want a form field to be selected when the page loads. But I get the error message Error: document.getElementById("ff") has no properties any ideas what I am doing wrong? code below
1
by: subvit | last post by:
function test_redirect(t,p) { 1) window.open("formappl.asp?id=1&apid="+t+"&prid="+p,'email','width=950,height=600,top=50,left=50'); 2) ...
6
by: therig | last post by:
I'm having issues, I've spent many hours searching and I'm a noob at javascript, any help will be greatly appreciated. I keep getting the following error: Error: document.forms.sec11_A has no...
4
by: manjugi | last post by:
Hi, I am running som web application at some point i have one web page contains some buttons,text field etc.when i click on button it gives an error message stating that "error:...
3
by: shiks1305 | last post by:
this js function is giving javascript error: document.forms.elements is null or not an object function DisableText() { var count = document.forms.elements.length; for (i=0; i<count; i++) {...
2
by: vps | last post by:
Please help me get the value of a textarea field: --------------------- The script --------------------- <html> <head> <script type="text/javascript">
8
by: ananjy | last post by:
Hi when i m trying to execute my ajax code using a link to display datas from another page named second.php., i got an error when the page loads in "ie"., which runs perfectly in firefox., here...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.