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 

Using Excel XP instead of Excel 2000 in D2006

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





PostPosted: Tue Sep 19, 2006 9:31 pm    Post subject: Using Excel XP instead of Excel 2000 in D2006 Reply with quote



Hello,

It appears Excel XP has chagned at least a couple of interface methods
since Excel 2000. "Find" (as in _WorkSheet.Cells.Find)is one of those
such methods. My application now wraps the Excel XP interface however I
still want to remain compatible with Excel 2000.

The "Find" wrapper from Excel XP is like so:

function Find(What: OleVariant; After: OleVariant; LookIn: OleVariant;
LookAt: OleVariant; SearchOrder: OleVariant; SearchDirection:
XlSearchDirection; MatchCase: OleVariant; MatchByte: OleVariant;
SearchFormat: OleVariant): ExcelRange; dispid 398;

The "Find" wrapper from Excel 2000 is like so: (if I recall correctly)

function Find(What: OleVariant; After: OleVariant; LookIn: OleVariant;
LookAt: OleVariant; SearchOrder: OleVariant; SearchDirection:
XlSearchDirection; MatchCase: OleVariant): ExcelRange; dispid 398;

The last two variants are missing in the 2000 installment. How can I
make this call compatible with both??

Thanks
Back to top
Deborah Pate (TeamB)
Guest





PostPosted: Tue Sep 19, 2006 10:54 pm    Post subject: Re: Using Excel XP instead of Excel 2000 in D2006 Reply with quote



<<Slycaper:
The last two variants are missing in the 2000 installment. How can
I make this call compatible with both??
Quote:


If you use the Excel 2000 type library your code will be compatible
with later versions of Excel. However you won't be able to access
later Excel features. If you need those you can either 1) use late
binding for changed methods or 2) use the later type library, but
be extremely careful to use the old versions of all methods that
have changed on machines using 2000 (which you can check by looking
at the ExcelApplication's Version property). If you look at the
type library file you'll see the old versions of all the interface
methods are still there, but prefixed with an underscore.

--
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
slycaper
Guest





PostPosted: Tue Sep 19, 2006 11:36 pm    Post subject: Re: Using Excel XP instead of Excel 2000 in D2006 Reply with quote



Deborah Pate (TeamB) wrote:
Quote:
Slycaper:
The last two variants are missing in the 2000 installment. How can
I make this call compatible with both??

If you use the Excel 2000 type library your code will be compatible
with later versions of Excel. However you won't be able to access
later Excel features. If you need those you can either 1) use late
binding for changed methods or 2) use the later type library, but
be extremely careful to use the old versions of all methods that
have changed on machines using 2000 (which you can check by looking
at the ExcelApplication's Version property). If you look at the
type library file you'll see the old versions of all the interface
methods are still there, but prefixed with an underscore.


Thanks Deborah,

I noticed that the interface methods are prefixed with an underscore.
"Open" is one such method. I'm using "_Open" in this case. I cannot
locate the alternate "Find" method. I don't believe there is one. Am I
correct?

Cheers
Back to top
Deborah Pate (TeamB)
Guest





PostPosted: Wed Sep 20, 2006 1:13 am    Post subject: Re: Using Excel XP instead of Excel 2000 in D2006 Reply with quote

<<Slycaper:
I cannot locate the alternate "Find" method. I don't believe there
is one. Am I correct?
Quote:


Yes. So with that you have to use late binding so you can omit the
added parameters.

--
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.