 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Dwaine Horton Guest
|
Posted: Fri Jun 03, 2005 6:51 pm Post subject: Need help with cells.find |
|
|
I have a program that loads data into Excel from a query. I then run another query to get another list. I first want to verify that the item in my second list doesn't exist on my spreadsheet already. I am trying to use the cells.find but am having problems assigning the result of the cells.find function. I also need to put the result in an if statement.
I am trying the following:
worksheet.Cells.Find(DM.qryAgree.FieldByname('NI 1234').AsString,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,False,emptyparam)
What does cells.find return?
How can I put this in an if statement?
Thanks
Dwaine
|
|
| Back to top |
|
 |
Dwaine Horton Guest
|
Posted: Mon Jun 06, 2005 1:19 pm Post subject: Re: Need help with cells.find |
|
|
Chris Cheney <cjc1@nospam%ucs.cam.ac.uk%no%spam%please> wrote:
| Quote: | "Dwaine Horton" <dwaine.horton (AT) york (DOT) com> wrote in
news:42a0a69b$1 (AT) newsgroups (DOT) borland.com:
worksheet.Cells.Find(DM.qryAgree.FieldByname('NI
1234').AsString,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,F
alse,emptyparam)
What does cells.find return?
A Range object.
How can I put this in an if statement?
You probably want to use its Value property.
|
Ok, I set the following up and I get an Invalid variant type conversion:
Var
range: variant;
begin
range := worksheet.Cells.Find(DM.qryAgree.FieldByname('X_LAWSON_INVOICE_NUMBER_YORK').AsString,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,False,emptyparam)
if range.value = DM.qryAgree.FieldByname('X_LAWSON_INVOICE_NUMBER_YORK').AsString Then
begin
....
end;
I get the error when I try to assign the range value from the cells.find to my range variable.
|
|
| 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
|
|