 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
bill Guest
|
Posted: Mon Jan 03, 2005 5:54 am Post subject: How do I get the total Record Counts of Excel |
|
|
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
|
Posted: Mon Jan 03, 2005 10:49 am Post subject: Re: How do I get the total Record Counts of Excel |
|
|
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
|
Posted: Mon Jan 03, 2005 11:55 am Post subject: Re: How do I get the total Record Counts of Excel |
|
|
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
|
Posted: Mon Jan 03, 2005 12:30 pm Post subject: Re: How do I get the total Record Counts of Excel |
|
|
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
|
Posted: Tue Jan 04, 2005 12:53 am Post subject: Re: How do I get the total Record Counts of Excel |
|
|
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 |
|
 |
|
|
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
|
|