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 do I get the total Record Counts of Excel

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





PostPosted: Mon Jan 03, 2005 5:54 am    Post subject: How do I get the total Record Counts of Excel Reply with quote



Hi everyone,
I am using OLE Automation to read datas from Excel files.
But i don't know how to detect the total RecordCounts of every Sheet .

Thanks!

PS: I am using Delphi5.0 Enterprise Edition

bill



Back to top
Mariusz Celmer
Guest





PostPosted: Mon Jan 03, 2005 10:49 am    Post subject: Re: How do I get the total Record Counts of Excel Reply with quote



I'm not sure what information you need but this can help I hope:

LSheet.Range['A1:C10'].Value := 'X';
LRange := LSheet.UsedRange;
LSheet.Range['A12'].Value := 'UsedRange: ' + LRange.Address;
LSheet.Range['A13'].Value := 'UsedRange Rows: ' +
IntToStr(LRange.Rows.Count);
LSheet.Range['A14'].Value := 'UsedRange Columns: ' +
IntToStr(LRange.Columns.Count);


"bill" <bill (AT) dingey (DOT) com.tw> wrote

Quote:
Hi everyone,
I am using OLE Automation to read datas from Excel files.
But i don't know how to detect the total RecordCounts of every Sheet .

Thanks!

PS: I am using Delphi5.0 Enterprise Edition

bill






Back to top
bill
Guest





PostPosted: Mon Jan 03, 2005 11:55 am    Post subject: Re: How do I get the total Record Counts of Excel Reply with quote



Hi,
Sorry for my poor English!
And, Thank you very much. Your methold seems worked!
I just want to get the rows numbers of Excel file that has data in the
cell.
The " nRowCount := LSheet.UsedRange.Rows.Count; " did it!
Thank you again!
bill




"Mariusz Celmer" <Mariusz.Celmer (AT) poczta (DOT) neostrada.pl> 在郵件
news:41d922e9 (AT) newsgroups (DOT) borland.com 中撰寫...
Quote:
I'm not sure what information you need but this can help I hope:

LSheet.Range['A1:C10'].Value := 'X';
LRange := LSheet.UsedRange;
LSheet.Range['A12'].Value := 'UsedRange: ' + LRange.Address;
LSheet.Range['A13'].Value := 'UsedRange Rows: ' +
IntToStr(LRange.Rows.Count);
LSheet.Range['A14'].Value := 'UsedRange Columns: ' +
IntToStr(LRange.Columns.Count);


"bill" <bill (AT) dingey (DOT) com.tw> wrote in message
news:41d8dcac$1 (AT) newsgroups (DOT) borland.com...
Hi everyone,
I am using OLE Automation to read datas from Excel files.
But i don't know how to detect the total RecordCounts of every Sheet .

Thanks!

PS: I am using Delphi5.0 Enterprise Edition

bill








Back to top
Mariusz Celmer
Guest





PostPosted: Mon Jan 03, 2005 12:30 pm    Post subject: Re: How do I get the total Record Counts of Excel Reply with quote

in this situation my example will works only if your data records are
continously filled in the worksheet, I mean in example from row 1 to 50
without empty rows. If there would be some empty rows (rows without data)
then my example return the same value.

Do you have some empty rows (records) in worksheets you like to count in,
and do you need to count them also or not?

Mariusz


"bill" <bill (AT) dingey (DOT) com.tw> wrote

Quote:
Hi,
Sorry for my poor English!
And, Thank you very much. Your methold seems worked!
I just want to get the rows numbers of Excel file that has data in the
cell.
The " nRowCount := LSheet.UsedRange.Rows.Count; " did it!
Thank you again!
bill




"Mariusz Celmer" <Mariusz.Celmer (AT) poczta (DOT) neostrada.pl> 在郵件
news:41d922e9 (AT) newsgroups (DOT) borland.com 中撰寫...
I'm not sure what information you need but this can help I hope:

LSheet.Range['A1:C10'].Value := 'X';
LRange := LSheet.UsedRange;
LSheet.Range['A12'].Value := 'UsedRange: ' + LRange.Address;
LSheet.Range['A13'].Value := 'UsedRange Rows: ' +
IntToStr(LRange.Rows.Count);
LSheet.Range['A14'].Value := 'UsedRange Columns: ' +
IntToStr(LRange.Columns.Count);


"bill" <bill (AT) dingey (DOT) com.tw> wrote in message
news:41d8dcac$1 (AT) newsgroups (DOT) borland.com...
Hi everyone,
I am using OLE Automation to read datas from Excel files.
But i don't know how to detect the total RecordCounts of every Sheet
..

Thanks!

PS: I am using Delphi5.0 Enterprise Edition

bill










Back to top
bill
Guest





PostPosted: Tue Jan 04, 2005 12:53 am    Post subject: Re: How do I get the total Record Counts of Excel Reply with quote

Yes, it could be some empty rows in worksheets and i also need to count
them .
So the example returns the same value is just what i want.
Thank you very much.
bill


"Mariusz Celmer" <Mariusz.Celmer (AT) poczta (DOT) neostrada.pl> 在郵件
news:41d93a7b (AT) newsgroups (DOT) borland.com 中撰寫...
Quote:
in this situation my example will works only if your data records are
continously filled in the worksheet, I mean in example from row 1 to 50
without empty rows. If there would be some empty rows (rows without data)
then my example return the same value.

Do you have some empty rows (records) in worksheets you like to count in,
and do you need to count them also or not?

Mariusz


"bill" <bill (AT) dingey (DOT) com.tw> wrote in message
news:41d93121 (AT) newsgroups (DOT) borland.com...
Hi,
Sorry for my poor English!
And, Thank you very much. Your methold seems worked!
I just want to get the rows numbers of Excel file that has data in the
cell.
The " nRowCount := LSheet.UsedRange.Rows.Count; " did it!
Thank you again!
bill




"Mariusz Celmer" <Mariusz.Celmer (AT) poczta (DOT) neostrada.pl> 在郵件
news:41d922e9 (AT) newsgroups (DOT) borland.com 中撰寫...
I'm not sure what information you need but this can help I hope:

LSheet.Range['A1:C10'].Value := 'X';
LRange := LSheet.UsedRange;
LSheet.Range['A12'].Value := 'UsedRange: ' + LRange.Address;
LSheet.Range['A13'].Value := 'UsedRange Rows: ' +
IntToStr(LRange.Rows.Count);
LSheet.Range['A14'].Value := 'UsedRange Columns: ' +
IntToStr(LRange.Columns.Count);


"bill" <bill (AT) dingey (DOT) com.tw> wrote in message
news:41d8dcac$1 (AT) newsgroups (DOT) borland.com...
Hi everyone,
I am using OLE Automation to read datas from Excel files.
But i don't know how to detect the total RecordCounts of every
Sheet
.

Thanks!

PS: I am using Delphi5.0 Enterprise Edition

bill












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.