BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi Sam,
Thank you for using Syncfusion products.
XlsIO does not have direct methods
to achieve the functionalities like ‘Selection.End(xlDown).Select’.
But, this can be achieved through a workaround and we have shared the
workaround sample in the following link. Kindly try this and let us know if this
helps.
Sample Link: http://www.syncfusion.com/downloads/support/directtrac/118257/XlsIOSample938581989.zip
Please let us know if you have any queries.
Regards,
Sudha R
Hi,
I'm facing the same issue but I'm not able to download the sample solution that you've provided. Can you please give me the access for the above sample solution.
Thanks,
Nivas.
Hi Nivas,
Greetings from Syncfusion.
We have prepared the sample to fetch the last cell. Kindly try this and let us know if it helps.
Code snippet:
FileStream inputStream = new FileStream("Sample.xlsx", FileMode.Open); IWorkbook workbook = excelEngine.Excel.Workbooks.Open(inputStream); IWorksheet worksheet = workbook.Worksheets[0];
IRange cell = worksheet.Range["A1"]; IRange usedRange = worksheet.UsedRange; var lastcell = ""; int col = cell.Column; int lastRow;
for (int row = 1; row <= usedRange.LastRow; row++) { if (!worksheet[row, col].IsBlank) { lastcell = worksheet[row, col].AddressLocal; lastRow = row; } } |
The complete sample can be downloaded from the below link.
Sample link - https://www.syncfusion.com/downloads/support/directtrac/general/ze/F-118257-1179841992
Regards,
Ramya