Bytescout.XLS for .NET
|
Bytescout.XLS library for .NET
How to load and check if spreadsheet contains correct dates for persons (if person is a teenager and so his/here current age is from 10 to 19) and mark incorrect birth dates with red color using Bytescout.XLS library for .NET This source code sample "checking if person is teenager or not" demonstrates how to use Bytescout.XLS library to open existing Excel (.XLS) document and verify birth dates of persons. If current age of a person is beetwen 10 and 19 so he/she is a teenager but if age is not beetween 10 and 19 then this person is not a teenager and the cell is marked with red background color Download example source code: bytescoutxls_validate_datetime_in_cells.zip (8 KB) Output spreadsheet document with validated birth dates where incorrect birth dates are marked with red color:
using System; namespace HelloWorld // Get worksheet by name // Years range // Minimum age // Minimum year // Check dates // Create birth date DateTime dateBirth = DateTime.FromOADate(daysBorn); // Check current cell // Markup wrong cell by red color // Set cell format // Save document // Close document // open generated XLS document in
default program } Download example source code: bytescoutxls_validate_datetime_in_cells.zip (8 KB) First steps tutorials: |
|
|
||