 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Quantium Guest
|
Posted: Thu Sep 23, 2004 9:21 am Post subject: How to get row count and column count from Excel worksheet |
|
|
In my application, I have been opened a Excel file, and I will read data from this Excel file, but i does not known how many row count and column count in this active workshet. i have code following:
eapp.select.rows.count
eapp.select.columns.count
but there value are 1, and i want to get data row count in this worksheet,so How to get row count and column count in Excel worksheet?
thanks!
|
|
| Back to top |
|
 |
Deborah Pate (TeamB) Guest
|
Posted: Thu Sep 23, 2004 9:51 am Post subject: Re: How to get row count and column count from Excel workshe |
|
|
<
i want to get data row count in this worksheet
If you've got a WS variable,
WS := Excel.Activesheet as _Worksheet;
the simplest way is
WS.UsedRange[lcid].Rows.Count;
Saving the worksheet first will update the UsedRange
property.
Another way is to use
WS.Cells.SpecialCells(xlCellTypeLastCell,
EmptyParam).Row;
--
Deborah Pate (TeamB) http://delphi-jedi.org
TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
http://www.borland.com/newsgroups/genl_faqs.html
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|