Syncfusion.XlsIO.Base
Example 


DateTime Property (IRange)

Gets or sets DateTime value in the Range.
Syntax
'Declaration
 
Property DateTime As Date
'Usage
 
Dim instance As IRange
Dim value As Date
 
instance.DateTime = value
 
value = instance.DateTime
DateTime DateTime {get; set;}
Remarks
Gets DateTime.MinValue if not all cells in the Range have same DateTime value.
Example
The following code illustrates how to set and access DateTime property of the Range.
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
            
IWorksheet sheet = workbook.Worksheets[0];
sheet.Range[2, 4].DateTime = DateTime.Now;
DateTime dateTime = sheet.Range[2, 4].DateTime;
            
workbook.SaveAs("DateTime.xlsx");
workbook.Close();
excelEngine.Dispose();
AssemblyVersion

Syncfusion.XlsIO.Base: 16.3460.0.29

See Also