BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to get row count and column count from Excel worksheet

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Quantium
Guest





PostPosted: Thu Sep 23, 2004 9:21 am    Post subject: How to get row count and column count from Excel worksheet Reply with quote




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





PostPosted: Thu Sep 23, 2004 9:51 am    Post subject: Re: How to get row count and column count from Excel workshe Reply with quote



< i want to get data row count in this worksheet
Quote:


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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.