Hi Khanh Dang,
Greetings from Syncfusion.
Kindly make use of the following code snippet to achieve your requirement.
Code snippet:
|
Dim intersectRange As IRange = worksheet.IntersectRanges(worksheet.Range("C1:G10"), worksheet.Range("D3:Q6"))
If intersectRange IsNot Nothing Then
Console.WriteLine("true")
End If |
You can see that we have changed the range “D6:Q3” into “D3:Q6”. Microsoft Excel automatically detects the ranges given in incorrect order and converts them into correct range format. Currently, XlsIO is not supported with such automatic conversion to correct range format. So we suggest you to supply the range in correct format (ie. range starting from minimum row/column value to maximum row/column value) like “D3:Q6”.
Kindly try the above code and let us know if it helps.
Regards,
Shamini