Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Automation code optimisation With statement

Status
Not open for further replies.

Smithy1001

Programmer
Jun 9, 2006
8
GB
Hi
I am using late binding with excel. I cannot use the following scenario. I have even tried putting ws.pagesetup as a variant.
ws.pagesetup.centerheader := 'This works'; //GOOD
with ws.pagesetup do //FAILS HERE
begin
CenterHeader := 'This does not';
end;

I have seen examples like this on the web but it fails within Delphi 2010. Even if I put ws.pagesetup as a variant it still fails. WS is declared earlier and everything from format conditions to ranges is working fine. I just can't write the with statements.
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top