Created
December 23, 2020 06:47
-
-
Save sohail-aspose/87c28286360b9f0b2948524ddb6d82e7 to your computer and use it in GitHub Desktop.
Delete Blank Rows From an Excel Document
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Aspose.Cells; | |
// Open an existing excel file. | |
Workbook wb = new Workbook("SampleInput.xlsx"); | |
// Get the worksheets collection in the spreadsheet. | |
WorksheetCollection sheets = wb.Worksheets; | |
// Get first Worksheet from WorksheetCollection by index. | |
Worksheet sheet = sheets[0]; | |
// Or by name. | |
// Worksheet sheet = sheets["Sheet1"]; | |
// Delete the Blank Rows from the worksheet. | |
sheet.Cells.DeleteBlankRows(); | |
// Save the excel file. | |
wb.Save("SampleOutput.xlsx"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment