/*

31 characters

Microsoft Excel does not allow worksheet name longer than 31 characters.

*/

/*

Excel Worksheet Naming Rules and Tips
► A worksheet name cannot cannot exceed 31 characters. ► A worksheet name cannot be left blank. ► A worksheet cannot be named history in either lower or uppercase.

*/

 

using C1.C1Excel;

 

namespace Problem

{

    class Program

    {

        public static void Main(string[] args)

        {

            Problem_2021_10_15 nm = new Problem_2021_10_15();

            nm.running();

        }

    }

    class Problem_2021_10_15

    {

        public void running()

        {

            C1XLBook book = new C1XLBook();

            XLSheet sheet = book.Sheets[0];

            sheet.Name="1234567890123456789012345678901";
            //Microsoft Excel does not allow worksheet name longer than 31 characters.

            XLStyle style = new XLStyle();

            style.AlignHorz = XLAlignHorzEnum.Center;

            XLCell cell = sheet[1,0];

            cell.Value="1234567890123456789012345678901";
            //Microsoft Excel does not allow worksheet name longer than 31 characters.

        }

    }

}

+ Recent posts