Hi,
Hi Subhankar,
Thank you so much for providing the sample code for the test scenario. Your code is absolutely perfect and working fine. Following are the details of my testing environment.
Operating System: Windows XP
Visual Studio: VS 2005
Aspose Version: V.5.2.2
I think if you are using old version then please try the latest version of Aspose.Cells, find attached for the new version of Aspose.Cells.
If still you face any problem please let us know.
Regards,
Hi,
Hi,
It works absolutely fine using your code. Here is my sample code and attached the output file.
Workbook wrkBook = new Workbook();
Worksheet sheet1 = wrkBook.Worksheets[0];
Cells cells = sheet1.Cells;
Style fontStyle = new Style();
Style style = new Style();
Aspose.Cells.Style stylefont = wrkBook.Styles[wrkBook.Styles.Add()];
stylefont.Font.Name = “Arial”;
stylefont.Font.Size = 9;
StyleFlag flag = new StyleFlag();
flag.FontName = true;
flag.FontSize = true;
cells.ApplyStyle(stylefont, flag);
wrkBook.Save(“e:\test\myoutputfile_testing.xls”);
Thank you.
Hi,
Hi,
It works fine too if I save the file to XLSX format. I am using the latest version/fix v5.2.0.3(attached), please try it.
Sample code:
Workbook wrkBook = new Workbook();
Worksheet sheet1 = wrkBook.Worksheets[0];
Cells cells = sheet1.Cells;
Style fontStyle = new Style();
Style style = new Style();
Aspose.Cells.Style stylefont = wrkBook.Styles[wrkBook.Styles.Add()];
stylefont.Font.Name = “Arial”;
stylefont.Font.Size = 9;
StyleFlag flag = new StyleFlag();
flag.FontName = true;
flag.FontSize = true;
cells.ApplyStyle(stylefont, flag);
wrkBook.Save(“e:\test\myoutputfile_testing.xlsx”);
the output file is also attached.
Thank you.