Range.PutValue

Range.PutValue method

Puts a value into the range, if appropriate the value will be converted to other data type and cell’s number format will be reset.

public void PutValue(string stringValue, bool isConverted, bool setStyle)
ParameterTypeDescription
stringValueStringInput value
isConvertedBooleanTrue: converted to other data type if appropriate.
setStyleBooleanTrue: set the number format to cell’s style when converting to other data type

Examples

using System;
using Aspose.Cells;

namespace AsposeCellsExamples
{
    public class RangeMethodPutValueWithStringBooleanBooleanDemo
    {
        public static void Run()
        {
            Workbook workbook = new Workbook();
            Cells cells = workbook.Worksheets[0].Cells;
            Aspose.Cells.Range range = cells.CreateRange("A1:B10");
            range.PutValue("123", true, false);
            
            Console.WriteLine("Value at A5: " + cells["A5"].DoubleValue);
        }
    }
}

See Also