ByteScout Data Extraction Suite - VB.NET - Validate cells with dates with spreadsheet sdk - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout Data Extraction Suite – VB.NET – Validate cells with dates with spreadsheet sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Data Extraction Suite – VB.NET – Validate cells with dates with spreadsheet sdk

validate cells with dates with spreadsheet sdk in VB.NET and ByteScout Data Extraction Suite

Learn to code validate cells with dates with spreadsheet sdk in VB.NET: How-To tutorial

The example source codes on this page will display you how to make validate cells with dates with spreadsheet sdk in VB.NET. ByteScout Data Extraction Suite was made to help with validate cells with dates with spreadsheet sdk in VB.NET. ByteScout Data Extraction Suite is the bundle that includes three SDK tools for data extraction from PDF, scans, images and from spreadsheets: PDF Extractor SDK, Data Extraction SDK, Barcode Reader SDK.

This rich and prolific sample source code in VB.NET for ByteScout Data Extraction Suite contains various functions and options you should do calling the API to implement validate cells with dates with spreadsheet sdk. Just copy and paste this VB.NET sample code to your VB.NET application’s code editor, add a reference to ByteScout Data Extraction Suite (if you haven’t added yet) and you are ready to go! This basic programming language sample code for VB.NET will do the whole work for you in implementing validate cells with dates with spreadsheet sdk in your app.

ByteScout Data Extraction Suite is available as a free trial. You may get it from our website along with all other source code samples for VB.NET applications.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Module1.vb
      
Imports Bytescout.Spreadsheet Imports System.IO Module Module1 Sub Main() ' in this sample we scan cells with ages data for people ' then mark all dates where age is between 10 and 19 years and mark these cells with red color ' Create new Spreadsheet Dim document As New Spreadsheet() document.LoadFromFile("Data.xls") ' Get worksheet by name Dim worksheet As Worksheet = document.Workbook.Worksheets.ByName("Sample") ' Years range Dim RangeMin As Integer = 10 Dim RangeMax As Integer = 19 ' Minimum age Dim YearMin As DateTime = DateTime.Now ' Maximum age Dim YearMax As DateTime = DateTime.Now ' Minimum year YearMax = YearMax.AddYears(-RangeMin) ' Maximum year YearMin = YearMin.AddYears(-RangeMax) ' Check dates For i As Integer = 1 To 7 ' Set current cell Dim currentCell As Cell = worksheet.Cell(i, 1) Dim dateBirth As DateTime = currentCell.ValueAsDateTime ' Check current cell If dateBirth < YearMin Or dateBirth > YearMax Then ' Set fill pattern currentCell.FillPattern = Bytescout.Spreadsheet.Constants.PatternStyle.Solid ' Markup wrong cell by red color currentCell.FillPatternForeColor = System.Drawing.Color.Red End If ' Set cell format currentCell.NumberFormatString = "dd.mm.yyyy" Next ' remove output file if already exists If File.Exists("Output.xls") Then File.Delete("Output.xls") End If ' Save document document.SaveAs("Output.xls") ' Close Spreadsheet document.Close() ' open in default spreadsheets viewer/editor Process.Start("Output.xls") End Sub End Module

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next