Hi Brian

Thanks for your replies.
What was strange was that I had not changed the code at all, and the line (below) 
that caused the compiler error in D7 compiled perfectly in in D5.
I then removed the Ole package (in D7) that had Excel2000 and added the one that 
had Excel97 - so things should have been exactly the same, except for the Delphi 
version, but still got the compiler error.

If I understand what you are saying, below, then the change to RangeE: OleVariant 
should just defer the error from Compile to Run time.  But it doesn't even cause an 
error at run time, it has fixed it completely.

Weird (but I'm not complaining!).

Mark

On 21 Oct 2003 at 17:24, Brian Wrigley wrote:

> 
> ----- Original Message -----
> From: "Mark Howard" <[EMAIL PROTECTED]>
> To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
> Sent: Tuesday, October 21, 2003 4:29 PM
> Subject: Re: [DUG]: D5 > D7 ExcelServer
> 
> 
> > OK - to answer my own question (in case there is anyone else in the world
> who
> > didn't already know this)
> >
> > Change
> > RangeE: Excel97(or Excel2000).Range
> > to
> > RangeE: OleVariant
> >
> > No idea why - but it works.
> 
> It works by deferring the syntax checking from compile-time to run-time,
> basically. The Delphi compiler is now happy because it no longer has any
> interest in the internals of that variable. It will allow you to refer to
> any methods and properties you like, and can no longer tell whether the
> object is supposed to have them or not. So now, if you refer to
> RangeE.NonExistentProperty the compiler will accept it and the error won't
> come until it tries to execute that line. There's probably a performance
> hit, too, but unless you're doing a lot of manipulation of the Excel objects
> it's probably unnoticeable.
> 
> Regards,
> Brian
> 
> ---------------------------------------------------------------------------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED] 
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
> 


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to