Question
6
Replies
4378
Views
Cognizant Technology Solutions
Posted: August 17, 2017
Last activity: November 6, 2018
Closed
Solved
Excel Row Count Column Count
Here is what I am trying to get a simple integer output of the used rows and columns in excel sheet. How can this be achieved using Open Span Excel connector?
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
Excel has a UsedRange property that returns a list of all the cells ever touched. It isn't super accurate and can be easily fooled. The best way is to use that and then check to make sure that the last row is actually "used (not empty). If it is iterate backwards through the rows until you reach a row that has a value by calling GetCellValue.
Attached is the automation that returns the Used Range (thank you to JeffBadger for this). I have attached the automation, a screenshot showing how to select the input parameter of _Worksheet, and how to call it in your automation.