how to determine last row in excel?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • poolboi
    New Member
    • Jan 2008
    • 170

    how to determine last row in excel?

    hi,

    i'm using C in windows
    hm...does anyone have any ideas how i can determine the last row number in an excel sheet using C?
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    Originally posted by poolboi
    hi,

    i'm using C in windows
    hm...does anyone have any ideas how i can determine the last row number in an excel sheet using C?

    Try to search for MFC librariries to read EXCEL files.
    I dont think so that are any available C Librarues to read excel files

    Raghuram

    Comment

    • poolboi
      New Member
      • Jan 2008
      • 170

      #3
      hm...okok
      it's alright...
      do u know if in C we can if say for example an array is empty or has no value
      how do we check for if an array is empty?
      perhaps i could do a similar concept and check if a cell is empty for an excel

      Comment

      • sicarie
        Recognized Expert Specialist
        • Nov 2006
        • 4677

        #4
        Excel spreadsheets have predefined "end" cells in both the row and the column. I forget what the number is, but it's very big.

        What library are you using to open and access the Excel file? What you will need to do is look through that library for - as you say - some sort of "isEmpty()" function, and then you can test each row until you find an empty one, and then each column until you find an empty one. Subtract one from each and you have your final cell with value.

        There are probably better ways to do this - there are great searching algorithms out there dealing with ants and swarm behavior, but I'm not sure if you want to implement one of those. Depends on your skill level and size of the project.

        Comment

        Working...