Click here to Skip to main content
15,883,883 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I need to get the contiguous range as we get using the Excel.Range.Union, but without using excel because for a large range excel becomes too slow.
Posted
Comments
BillWoodruff 30-Dec-14 7:21am    
If you are not using as data some Ranges on an Excel WorkSheet, then what is the data you are working with ? An Array[,] of Points, a List of Struct ... ?
rafik2010 30-Dec-14 7:26am    
I am comparing large excel files with millions of changes, so need to take a range of a changed cells.

e.g. If i get the changed cells like A1,A2,A3,B3,B4,B5,B6,... then i want to take a range like A1:A3,B3:B6,....

If i use excel.range.union then it takes too long to process the same, so i need some another method which do the same job as done by excel but without using excel.
BillWoodruff 30-Dec-14 7:32am    
Any solution that involves bypassing the InterOP relationship between VB.NET and Excel, means you will have to be able to access the data ... the state of "changed" cells ... "outside" of Excel. Are you doing that, or do you plan to do that ?

Do you have some kind of file that lists every changed Cell that you can process ?

rafik2010 30-Dec-14 7:39am    
I am planning to do that, but i just created a simple loop in which i go through all the cells and then create a range for the non-empty cells (just for checking the performance), which is too slow. But if i simple gather the cell address it gives a very fast result.

I just want a workaround using which i completely ignore excel and do the union of the cells.
BillWoodruff 30-Dec-14 7:47am    
It's time you show at least an outline of the code you are working with now so we don't play the twenty-questions game.

To me there is a real difference between identifying Cells whose value has been changed and identifying Cells which are unused, and Excel offers the 'UsedRange operator to return all those which are in use.

Please expand your question and show a clear example of exactly the output you expect from a clear example of the type of input you expect.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900