After you have inserted/exported a datatable into the worksheet, you need to calculate/find out the last/farthest row which has data in the cells. We recommend you to kindly use:
worksheet.Cells.MaxRow attribute —> to get the farthest row index which has data or style in the cell(s)
worksheet.Cells.MaxDataRow attribute – to get the farthest row index which contains data in the cells.
int nextrow = worksheet.Cells.MaxDataRow +1;
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.