Board index » delphi » Slow interaction with Excel

Slow interaction with Excel

I must do a long list of action in a Excel's sheet.
When i insert data, i use a VarArray which speed up my application, without insert every single value.
There is something to make the same think with several formatting action ?

--
nr

 

Re:Slow interaction with Excel


<<Nicola Regge:
When i insert data, i use a VarArray which speed up my
application, without insert every single value.
There is something to make the same think with several
formatting action ?

Quote

I believe that's what styles are for. :)

--
Deborah Pate

Re:Slow interaction with Excel


Don't understand.

Quote
Deborah Pate <d.p...@cableinet.co.not-this-bit.uk> wrote in message

39369326@dnews...
Quote
> <<Nicola Regge:
> When i insert data, i use a VarArray which speed up my
> application, without insert every single value.
> There is something to make the same think with several
> formatting action ?

> I believe that's what styles are for. :)

> --
> Deborah Pate

Re:Slow interaction with Excel


<<Nicola Regge:
Don't understand.

Quote

Hmm, well, perhaps it was I who didn't
understand. If you want to make a lot of
formatting changes to one range, you can
create a style that incorporates all those
changes and just apply it (Workbook.Styles
.Add(...). But if you want to make the same
formatting change to lots of different ranges,
you could use an olevariant to create a multi-
area range:

var
  WS: OleVariant;
  R: Range;
begin
  WS := Excel.ActiveSheet;
  IDispatch(R) := WS.Range['C5:D9,G9:H16,B14:D18'];
  R.Interior.Color := clTeal;

--
Deborah Pate

Re:Slow interaction with Excel


But if i must formatting a bord, i must send every command one by one ?

Quote
Deborah Pate <d.p...@cableinet.co.not-this-bit.uk> wrote in message

3937aefa@dnews...
Quote
> <<Nicola Regge:
> Don't understand.

> Hmm, well, perhaps it was I who didn't
> understand. If you want to make a lot of
> formatting changes to one range, you can
> create a style that incorporates all those
> changes and just apply it (Workbook.Styles
> .Add(...). But if you want to make the same
> formatting change to lots of different ranges,
> you could use an olevariant to create a multi-
> area range:

> var
>   WS: OleVariant;
>   R: Range;
> begin
>   WS := Excel.ActiveSheet;
>   IDispatch(R) := WS.Range['C5:D9,G9:H16,B14:D18'];
>   R.Interior.Color := clTeal;

> --
> Deborah Pate

Re:Slow interaction with Excel


<<Nicola Regge:
But if i must formatting a bord, i must send every
command one by one ?

Quote

Sorry, I'm not sure I understand. Would you like
to list some of the commands you'd like to
combine?

--
Deborah Pate

Other Threads