fileformat-cells / FileFormat.Cells-for-.NET

Written in native C#, FileFormat.Cells for .NET is a free, open-source SDK designed to easily create, load, and modify Microsoft Excel spreadsheets with just a few lines of code.

Home Page:https://www.fileformat.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Revisit insertValue Method of Worksheet

sabir-aspose opened this issue · comments

@fahadadeel insertValue(String, UInt32, Object, UInt32) is unfit. As discussed in #5, Cell object should work with cells contents. Worksheet should be used only when dealing with Ranges.

The insertValue method has undergone a comprehensive overhaul. Now, adding a value to a worksheet is simpler than ever! Instead of the older approach, you just need to provide the cell reference and utilize the PutValue method.

Here's a quick example to demonstrate the new functionality:

using (Workbook wb = new Workbook(filePath))
{
Worksheet firstSheet = wb.Worksheets[1];
Cell cell = firstSheet.Cells["D2"];
cell.PutValue("Fahad");
wb.Save();
}

This streamlined approach provides a more intuitive experience when interacting with worksheets. Give it a try and let us know your feedback!