Well, this class is now obsoleted. Instead, please use Workbook.CreateStyle() to
create and manipulate style for workbook instead of StyleCollection.Add() and
use Workbook.GetNamedStyle(string) to get named style instead of
StyleCollection[string].
FYI, while trying to keep the API as straightforward and clear as possible, we decided to recognize and honor the common development practices of the platform. Therefore, Aspose.Cells for .NET follows coding guidelines widely accepted by .NET developers now. With the release of Aspose.Cells for .NET version v5.0.0, we have re-organized the API classes for Aspose.Cells component. This change has some major aspects that we follow. We have added new namespaces. All the API (classes, interfaces, enumerations, structures etc.) were previously located in the Aspose.Cells namespace. Now, certain sets of API have been moved to their relative namespaces, which make the relationship of classes (with their members) and namespaces clear and simplified.
Let me come towards your most significant errors that you might encounter while upgrading to newer versions of the product from v4.7,x so you can fix them accordingly:
1) You need to import the relevant namesapaces or use fully qualified naming when declaring objects for classes etc.:
e.g
using System;
using System.Web;
using Aspose.Cells;
using Aspose.Cells.Pivot;
…
etc.
we have moved certain APIs to the respective namespaces:
i.e.,
Aspose.Cells Contains all classes of Aspose.Cells
Aspose.Cells.Charts Contains all classes of chart and sparkline
Aspose.Cells.Drawing Contains all classes of shapes and fill format
Aspose.Cells.ExternalConnections Contains all classes of external connections
Aspose.Cells.Markup Contains all classes of smart tag
Aspose.Cells.Pivot Contains all classes of PivotTable
Aspose.Cells.Properties Contains all classes of document and worksheet properties
Aspose.Cells.Rendering Contains all classes of Rendering image and pdf
Aspose.Cells.Rendering.PdfSecurity Contains all security options of Rendering pdf
Aspose.Cells.Tables Contains all classes of Table(List Object)
etc.
…
2) Some classes are renamed especially collection classes. e.g
i) Validations → ValidationCollection
ii) PivotTables → PivotTableCollection
iii) Worksheets —> WorksheetCollection
etc.
3) Aspose.Cells.Style property is eliminated/obsoleted now, you should adjust your code to use Aspose.Cells.GetStyle() and Aspose.Cells.SetStyle() methods/ approach, it will also enhance the performance to certain extent:
e.g
Your sample code using Style attribute should be updated accordingly, e.g
Style style = wsNdaa.Cells[0, 0].GetStyle();
style.Font.IsBold = true;
wsNdaa.Cells[0, 0].SetStyle(style);
Styyle style2 = cells[“I1”].GetStyle();
style2.HorizontalAlignment = TextAlignmentType.Center;
style2.BackgroundColor = System.Drawing.Color.Navy;
style2.Font.IsBold = true;
cells[“I1”].SetStyle(style2);
We recommend you to kindly see the Aspose.Cells for .NET Wiki Conf. Docs for your reference, especially the topics in the sections/ sub sections:
Please see the API Reference pages especially for your complete reference:
Hope, this helps you a bit.
Thank you.