Created
December 23, 2020 06:47
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