We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Change a property of a named style

Suppose I want to change a property of a named style.

At the point where the workbook is created, I have

var nstyle = a.book.GetNamedStyle(“Normal”);
var font = nstyle.Font;
font.DoubleSize = 15.0;
font.IsItalic = true;
font.Name = “Arial”;

This has no effect on the properties of the Normal style of the generated Excel workbook. So how do I change the properties of a named style? Or should I be able to do that?

Thanks,
Bill Below

Hi Bill,


Thank you for contacting Aspose support.

I have evaluated the presented scenario and I am able to notice the said issue therefore I have raised an investigative ticket with Id CELLSNET-44344. Please spare us little time to look further into this matter and revert back with updates.

Hi,


Please call Style.Update method to make the named style taken effect.
See following sample code for your reference:
e.g
Sample code:

var book = new Workbook();
var nstyle = book.GetNamedStyle(“Normal”);
// book.CreateBuiltinStyle(BuiltinStyleType.Normal);
var font = nstyle.Font;
font.Name = “Arial”;
font.DoubleSize = 15.0;
font.IsItalic = true;
font.Color = Color.Blue;
nstyle.Update();

Thank you.