We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

XlsIO component and removing blank cells

Thread ID:





145121 May 30,2019 10:13 AM UTC Jun 10,2019 01:45 PM UTC WinForms 1
Tags: XlsIO
Davide Bitetto
Asked On May 30, 2019 10:13 AM UTC


  i'm trying to manipulate an xlsx file which has an enormous amount of blank cells (coming from another application) and I need to clean it programmatically.

  I've tried to do it by cycling through rows and cells.... but it takes really a lot of time (more than an hour).

  I've also tried to "filter" all good cells with the following linq query:

  IWorkbook workbookO = application.Workbooks.Open(@"<filename>");
  IWorksheet sheetO = workbookO.Worksheets["<sheetname>"];

  int cols = sheetO.Columns.Length;
  int rows = sheetO.Rows.Length;

  var source = sheetO.Range[1, 1, rows, cols].Cells.ToList().Where(x => !x.IsBlank);

  in source I obtain all not blank cells and it's very fast, but I'm not able anymore to re-convert them in a IRange, maybe to create a new excel file with only those cells.

  Any suggestion on how to solve this problem is apreciated.


Abirami Varadharajan [Syncfusion]
Replied On June 10, 2019 01:45 PM UTC

Hi Davide, 
Greetings from Syncfusion. 
We have prepared sample to remove blank rows in between and at the end. Please find the sample from the following link. 
Kindly check and let us know if your requirement has been fulfilled. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon