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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mady1380
    New Member
    • Sep 2006
    • 18

    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.Offic e.Interop.Excel .Application
    Dim MyWorkbook As Microsoft.Offic e.Interop.Excel .Workbook
    Dim MySheet As Microsoft.Offic e.Interop.Excel .Worksheet
    Dim MyCell As Microsoft.Offic e.Interop.Excel .Range

    MyExcel = New Microsoft.Offic e.Interop.Excel .Application
    MyExcel.Workboo ks.Open("C:\Ine tpub\wwwroot\Ad dNewPromotion\E xcel1.xls", , False)
    MyWorkbook = MyExcel.Applica tion.ActiveWork book
    MySheet = MyWorkbook.Acti veSheet
    Label1.Text() = MySheet.Cells.I tem(1, 1).value

    MySheet.Cells.I tem(2, 2).value = "madhu"

    MyExcel.ActiveW orkbook.SaveAs( "C:\Inetpub\www root\AddNewProm otion\Excel2.xl s")

    MyExcel.ActiveW orkbook.Close()
    MyExcel = Nothing
    MyWorkbook = Nothing
    MySheet = Nothing

    *************** *******End***** *************** **************
  • AricC
    Recognized Expert Top Contributor
    • Oct 2006
    • 1885

    #2
    Try this out:
    .Net + Excel
    Or...
    Some of these:
    More

    Comment

    Working...