Hello:
I want to write only a value into one excel`s cell , and save the excel file.
I want reserve all other cells` values .
I used NPOI ,it has to read all the value , and save them all into another sheet. It is not i want
How should I do ?
thanks!
How to save a value into only one excel`s cell ?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Sascha B122 reputationPosted Sep 22, 2010, 1:48 AM EDT
using Excel = Microsoft.Office.Interop.Excel; Excel.Application xlApp; Excel.Workbook xlWorkBook; Excel.Worksheet xlWorkSheet; Excel.Range range; object misValue = System.Reflection.Missing.Value; xlApp = new Excel.ApplicationClass(); // new Excel Application Class xlWorkBook = xlApp.Workbooks.Open(@"" + path, 0, false, 5, "" + password, "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0); // Definations xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(page); // Which Excel.Page range = xlWorkSheet.UsedRange; xlWorkSheet.get_Range("" + column + row, misValue).Formula = "" + value; xlWorkBook.Save(); // Save the data xlWorkBook.Close(true, @"" + path, false); // Closing th excel.workbook xlWorkSheet = null; xlApp.Workbooks.Close(); xlApp.Quit();