Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

Whenever you change the Cell.Style property, that Cell gets its own Style object. However, if you create a new Style object and then call SetStyle or ApplyStyle on the area or range you want to affect, ExcelApplication will not have to create a seperate Style object for each cell, reducing the amount of memory that is needed. For example, if you are applying the same style to more than one or two cells, you should say:

Alternatively, if you want to apply a single style to all the cells in a column, you can get the ColumnProperties object for that column and call its SetStyle method:

Using one of these two techniques to apply styles will use less memory than creating a new style for each cell or modifying the Cell.Style property directly.

  • No labels