Home

Bytescout.XLS for .NET
Screenshots

Click to view sample
Click to view sample
Click to view sample
Click to view sample
Click to view sample
Click to view sample
Click to view sample Click to view sample

Bytescout.XLS library for .NET

Download Free Trial Buy Now More Information

How to set active worksheet in the generated spreadsheet (this worksheet will be selected by default when spreadsheet is opened)

This source code sample demonstrates how to use Bytescout.XLS library to select default worksheet in spreadsheet (XLS or other format) document

Download example source code: bytescoutxls_select_active_worksheet.zip (4 KB)

Saved XLS document screenshot (Worksheet2 tab is selected by default)

Excel XLS document with 2nd worksheet selected by default

using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using Bytescout.XLS;
using Bytescout.XLS.Constants;

namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
// Create new XLSDocument
XLSDocument document = new XLSDocument();

// Add new worksheets
Worksheet worksheet1 = document.WorkBook.Worksheets.Add("Worksheet1");
Worksheet worksheet2 = document.WorkBook.Worksheets.Add("Worksheet2");
Worksheet worksheet3 = document.WorkBook.Worksheets.Add("Worksheet3");

// Activate worksheet2
worksheet2.Active = true;

// Save document
document.SaveAs("SelectingActiveWorksheet.xls");

// Close document
document.Close();

// open generated XLS document in default program
Process.Start("SelectingActiveWorksheet.xls");
}
}
}

Download example source code: bytescoutxls_select_active_worksheet.zip (4 KB)

Download Free Trial Buy Now More Information

Documentation online: view (separate window)

First steps tutorials:

Advanced Examples:
Products  |  Download  |  Purchase  |  Support  |  Contacts  |  Testimonials |  

ByteScout, 2003-2008. All other company and product names may be trademarks of their respective companies. Privacy Statement