ByteScout Spreadsheet SDK - C# - Set ShrinkToFit for Cells - ByteScout

ByteScout Spreadsheet SDK – C# – Set ShrinkToFit for Cells

  • Home
  • /
  • Articles
  • /
  • ByteScout Spreadsheet SDK – C# – Set ShrinkToFit for Cells

How to set shrinktofit for cells in C# and ByteScout Spreadsheet SDK

How to code in C# to set shrinktofit for cells with this step-by-step tutorial

With this source code sample you may quickly learn how to set shrinktofit for cells in C#. What is ByteScout Spreadsheet SDK? It 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. It can help you to set shrinktofit for cells in your C# application.

You will save a lot of time on writing and testing code as you may just take the C# code from ByteScout Spreadsheet SDK for set shrinktofit for cells below and use it in your application. Follow the instructions from the scratch to work and copy the C# code. Enjoy writing a code with ready-to-use sample codes in C#.

Trial version of ByteScout Spreadsheet SDK can be downloaded for free from our website. It also includes source code samples for C# and other programming languages.

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(); // Add new worksheet Worksheet worksheet = document.Workbook.Worksheets.Add("HelloWorld"); // Set cell value worksheet.Cell(0, 0).Value = "Very, very, very, very long text"; // Shrink text worksheet.Cell(0, 0).ShrinkToFit = true; // 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