Free Trial
Web API version
Licensing
Request A Quote
HAVE QUESTIONS OR NEED HELP? SUBMIT THE SUPPORT REQUEST FORM or write email to SUPPORT@BYTESCOUT.COM
Search Text | C#
Program.cs:
C#
using System; using Bytescout.Spreadsheet; using Bytescout.Spreadsheet.BaseClasses; namespace SearchText { class Program { static void Main(string[] args) { // Open spreadsheet from file Spreadsheet document = new Spreadsheet(); document.LoadFromFile("example.xls"); // Get first worksheet Worksheet worksheet = document.Workbook.Worksheets[0]; // Find cells containing "in" substring Cell cell = worksheet.Find( "in", false /*case insesitive*/, false /*not regexp*/, false /*search forward*/); while (cell != null) { // Print found cell address and value to console CellAddress address = cell.GetAddress(); string message = string.Format( "({0}, {1}): {2}", address.Column, address.Row, cell.ValueAsExcelDisplays); Console.WriteLine(message); cell = worksheet.FindNext(); } document.Dispose(); Console.WriteLine(); Console.WriteLine("Press any key to continue."); Console.ReadKey(true); } } }