This project has moved and is read-only. For the latest updates, please go here.

Copy Style

Jan 11, 2011 at 3:25 PM

Hi,

Is there any way to copy row/cell style from template excel to new row/cell ?

 

best regards,

Harun#?

Jan 11, 2011 at 5:49 PM

Hi,

Set the StyleID property from the cells you want to copy from.

Jan

Jan 17, 2011 at 9:12 PM

Hi again,

  Thanks. When I first tried to set StyleID property I was forget to create styles in new Workbook and got an exception ofcourse.

I just look for how to copy styles from template workbook to new workbook I have found something just want to ask you is that correct way to do it.

I'm just copying Workbook.StylesXml.InnerXml to newly created workbook and than setting StyleID of cells from Template to new cells.

regards,

Harun#?

Jan 19, 2011 at 7:35 AM

Hi,

You can use the Workbook.Styles.UpdateXml() method to update the Styles Xml before you copy.

Jan