Xceed Workbooks for .NET v3.0 Documentation
Xceed.Workbooks.NET Assembly / Xceed.Workbooks.NET Namespace / RowRange Class / AutoFit Method
Example


In This Topic
    AutoFit Method (RowRange)
    In This Topic
    Adjusts the Height based on the highest Cell in the RowRange
    Overload List
    OverloadDescription
    Identifies the start & end of the range affected by the AutoFit process by using Ids.  
    Identifies the start & end of the range affected by the AutoFit process by using string Ids.   
    Example
    using( var workbook = Workbook.Load( "test.xlsx" ) )
    
      {
        // Get the first worksheet. A workbook contains at least 1 worksheet.
        var worksheet = workbook.Worksheets[ 0 ];
            
        // AutoFit the rows "I" to "P", from 6th and going right, and make sure the row's heights are between 0 and 409.
    
        worksheet.Rows[ "I","P" ].AutoFit( 0, 255, 5);
    
        // Save workbook to disk.
        workbook.Save();
      }
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also