Row count in Xl sheet RRS feed

  • Question

  • Hi Guys,

    I am receiving  xlsx file in the form of stream and i need to count the rows . How can i do this?

    Friday, November 4, 2016 12:06 PM

All replies

  • Hi Giri Abhay,

    use the code mentioned below.

    iTotalColumns = xlWorkSheet.UsedRange.Columns.Count;
    iTotalRows = xlWorkSheet.UsedRange.Rows.Count;

    it will give you both number of used rows and columns.

    if you have any problem to implement this solution please let me know about that.

    here you did not mentioned in which type of project you are developing. you had posted this issue in VSTO forum and talking about Form in the post.

    if you are developing using Windows Application then you need to open the file , create an object of sheet and then implement the above mentioned code.



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Monday, November 7, 2016 2:26 AM