Every ByteScout tool includes sampleC# source codes that you can find here or in the folder with installed ByteScout product. Validate cell if value is in range with spreadsheet sdk in C# can be applied with ByteScout Barcode Suite. ByteScout Barcode Suite is the set that includes three different SDK products to generate barcodes, read barcodes and read and write spreadsheets: Barcode SDK, Barcode Reader SDK and Spreadsheet SDK.
If you want to quickly learn then these fast application programming interfaces of ByteScout Barcode Suite for C# plus the guideline and the C# code below will help you quickly learn validate cell if value is in range with spreadsheet sdk. If you want to implement this functionality, you should copy and paste code below into your app using code editor. Then compile and run your application. Further improvement of the code will make it more robust.
On our website you may get trial version of ByteScout Barcode Suite for free. Source code samples are included to help you with your C# application.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using Bytescout.Spreadsheet;
using System.IO;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
// Create new Spreadsheet
Spreadsheet document = new Spreadsheet();
document.LoadFromFile("Data.xls");
// Get worksheet by name
Worksheet worksheet = document.Workbook.Worksheets.ByName("Sample");
// Minimum age
int RangeMin = 10;
// Maximum age
int RangeMax = 19;
// Spellcheck words
for (int i = 1; i < 8; i++)
{
// Set current cell
Cell currentCell = worksheet.Cell(i, 1);
// Check current cell
if (System.Convert.ToInt32(currentCell.Value) < RangeMin || System.Convert.ToInt32(currentCell.Value) > RangeMax)
{
// Set fill pattern
currentCell.FillPattern = Bytescout.Spreadsheet.Constants.PatternStyle.Solid;
// Markup wrong cell by red color
currentCell.FillPatternForeColor = System.Drawing.Color.Red;
}
}
// delete output file if exists already
if (File.Exists("Output.xls")){
File.Delete("Output.xls");
}
// Save document
document.SaveAs("Output.xls");
// Close Spreadsheet
document.Close();
// open generated XLS document in default program
Process.Start("Output.xls");
}
}
}
60 Day Free Trial or Visit ByteScout Barcode Suite Home Page
Explore ByteScout Barcode Suite Documentation
Explore Samples
Sign Up for ByteScout Barcode Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
60 Day Free Trial or Visit ByteScout Barcode Suite Home Page
Explore ByteScout Barcode Suite Documentation
Explore Samples
Sign Up for ByteScout Barcode Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: