Excel Automation: how to find the last row numbers in an Excel Sheet?
Posted on 2005-04-30
I want to open an Excel file in VC++ and append new data to an existing worksheet. I need to find the last row number in the used range. It seems to be an easy problem, but I keep gettng a count of 25384. What's wrong with this code?
lpDisp = sheet.GetUsedRange();
long lTotalRows = range.GetCount();