


Hide scroll bars by setting the Workbook class' WorkbookSettings.IsVScrollBarVisible or WorkbookSettings.IsHScrollBarVisible property to false.īelow is a complete code that opens an Excel file, book1.xls, hides both scroll bars and then saves the modified file as output.xls. The problem was that, the way a spreadsheet was set up, half of its page was locked for fast reference, and, when scrolling, the scroll bar would move, but the data, apparently, wouldnt. In past editions of Excel, copying the worksheet was enough, but in Excel 2007, the scroll bar will not resize until you save the workbook. Even after you delete the extra rows, Excel will not restore the size of the workbook.
#EXCEL SCROLL BAR IN CELL FULL#
Make scroll bars visible by setting the Workbook class' WorkbookSettings.IsVScrollBarVisible or WorkbookSettings.IsHScrollBarVisible property to true. Another suggestion is to check for 'frozen pane' in Excel 2003, Window -> Freeze (or Unfreeze) Panes. The scroll-bar slider will return to full size. WorkbookSettings.IsVScrollBarVisible and WorkbookSettings.IsHScrollBarVisible are Boolean properties, which means that these properties can only store true or false values. To control the visibility of scroll bars, use the Workbook class' WorkbookSettings.IsVScrollBarVisible and WorkbookSettings.IsHScrollBarVisible properties. In programming parlance, this is known as the 'used range' of a worksheet. Suddenly your scroll bars move you into uncharted areas, such as column TX or row 5,000. The Workbook class provides a wide range of properties and methods for managing an Excel file. Its frustrating when Excel acts as if the active area of a worksheet is significantly larger than the actual area where you have data. Controlling the Visibility of Scroll BarsĪspose.Cells provides a class, Workbook that represents an Excel file. Using Aspose.Cells, developers can control the visibility of both types of scroll bars in Excel files. Microsoft Excel also provides horizontal and vertical scroll bars so that users can scroll through worksheet contents. Normally, there are two kinds of scroll bars: Scroll bars are used to navigate the contents of any file.

Both methods take the starting row or column index and the number of rows or columns that should be hidden as parameters. It is also possible to hide a row or column by setting the row height or column width to 0 respectively.ĭevelopers can hide multiple rows or columns at once by calling the HideRows and HideColumns methods of the Cells collection respectively.
