ByteScout Spreadsheet SDK - C# - Validate Data in Cell and Mark Wrong With Color - ByteScout

ByteScout Spreadsheet SDK – C# – Validate Data in Cell and Mark Wrong With Color

  • Home
  • /
  • Articles
  • /
  • ByteScout Spreadsheet SDK – C# – Validate Data in Cell and Mark Wrong With Color

validate data in cell and mark wrong with color in C# with ByteScout Spreadsheet SDK

How To: tutorial on validate data in cell and mark wrong with color in C#

Today you are going to learn how to validate data in cell and mark wrong with color in C#. ByteScout Spreadsheet SDK was made to help with validate data in cell and mark wrong with color in C#. ByteScout Spreadsheet SDK is the library (SDK) that is capable of writing, reading, modifying and calculating Excel and CSV spreadsheets. Most popular formulas can be calculated and reculculated with Excel installed. You may import or export data to and from CSV, XML, JSON as well as to and from databases, arrays.

This rich sample source code in C# for ByteScout Spreadsheet SDK includes the number of functions and options you should do calling the API to implement validate data in cell and mark wrong with color. Follow the instruction from the scratch to work and copy and paste code for C# into your editor. Use of ByteScout Spreadsheet SDK in C# is also explained in the documentation included along with the product.

Our website provides free trial version of ByteScout Spreadsheet SDK. It comes along with all these source code samples with the goal to help you with your C# application implementation.

Try ByteScout Spreadsheet SDK today: Get 60 Day Free Trial or sign up for Web API

Program.cs
      
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"); // Spellcheck words for (int i = 0; i < 5; i++) { // Set current cell Cell currentCell = worksheet.Cell(0, i); // Spellcheck current cell if ((string)currentCell.Value == "Simpsan") { // Set fill pattern currentCell.FillPattern = Bytescout.Spreadsheet.Constants.PatternStyle.Solid; // Markup wrong word 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"); } } }

Try ByteScout Spreadsheet SDK today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

VIDEO

ON-PREMISE VERSION

Get 60 Day Free Trial or Visit ByteScout Spreadsheet SDK page

Explore ByteScout Spreadsheet SDK documentation

WEB API

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next