Smithy1001
Programmer
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
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