
Usability is a term that describes how well a person can interact with a program, website, or device. Factors that increase usability include ease of learning and efficiency of use. You can use color to increase your spreadsheet’s usability in several ways. For example, if you need to identify all cells in a spreadsheet whose values exceeded 1000, you could make that task easier by telling Excel to color those cells red. People could then identify them in seconds. By a spreadsheet’s row colors, you can give it a professional look and make it more legible. Furthermore, the styles are useful when you want all the headings in your workbook to look the same.
Colors also help you visualize your data more effectively by enabling you to recognize groups of related information by sight. Furthermore, you can use styles to help your worksheets and workbooks contain consistent formatting.
Cloud API for Worksheet processing
Aspose.Cells Cloud API provides the capabilities to create as well as manipulate MS Excel & OpenOffice spreadsheets available on the local system as well as hosted on the cloud. In order to process worksheets, you do not need to install any software including MS Office or OpenOffice, and all the processing is performed using the Cloud API. Please note that with every new release, we strive to bring more stability to the product as well as we put our efforts to introduce new features, which our APIs more robust. Therefore in the recent release of Aspose.Cells Cloud 20.7, we have significantly improved the features related to workbook creation, set cell characteristics, Get cell range values, and post cell styles.
Create workbook using C#
The API provides the capabilities to create an excel worksheet using fewer code lines. Even with a single code line, a new worksheet can be added to the existing Excel workbook. The code snippet below shows the steps to create a sample Excel workbook, add excel worksheet at the second index, and save the resultant file to Cloud storage.
string MyAppKey = "xxxxxxxx"; // Get AppKey from https://dashboard.aspose.cloud/ | |
string MyAppSid = "xxxxxxxxx"; // Get AppSID from https://dashboard.aspose.cloud/ | |
// Complete examples can be found over https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet | |
// create an instance of Cells Cloud API | |
CellsApi instance = new CellsApi(MyAppSid, MyAppKey); | |
// specify the name of resultant file | |
string name = "NewBook" + DateTime.Now.ToString("yymmddhhmiss") + ".xlsx"; | |
// save the Excel file to Cloud storage | |
instance.CellsWorkbookPutWorkbookCreate(name); | |
// add worksheet to second location | |
instance.CellsWorksheetsPutAddNewWorksheet(name, "Sheet2", 2); |
Get Cells range value
The API provides the feature to fetch, add or update Cells Data based on named range. In a recent release, the API has been improved to get range values from worksheet cells.
string MyAppKey = "xxxxxxxx"; // Get AppKey from https://dashboard.aspose.cloud/ | |
string MyAppSid = "xxxxxxxxx"; // Get AppSID from https://dashboard.aspose.cloud/ | |
// Complete examples can be found over https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet | |
// create an instance of Cells Cloud API | |
CellsApi instance = new CellsApi(MyAppSid, MyAppKey); | |
string name = "NewBook2056160256i53.xlsx"; | |
string sheetName = "Sheet1"; | |
int? firstRow = 0; | |
int? firstColumn = 0; | |
int? rowCount = 3; | |
int? columnCount = 2; | |
var response = instance.CellsRangesGetWorksheetCellsRangeValue(name, sheetName, null, firstRow, firstColumn, rowCount, columnCount); | |
NUnit.Framework.Assert.AreEqual(response.Code, 200); | |
var rangeName = "A1:B3"; | |
response = instance.CellsRangesGetWorksheetCellsRangeValue(name, sheetName, rangeName, null, null, null, null); | |
NUnit.Framework.Assert.AreEqual(response.Code, 200); | |
rangeName = "MyRange"; | |
response = instance.CellsRangesGetWorksheetCellsRangeValue(name, sheetName, rangeName, null, null, null, null); | |
NUnit.Framework.Assert.AreEqual(response.Code, 200); |
Apply Rich Text Formatting to Cell
The individual cell contains data and in order to properly distinguish the data of each cell, a specific formatting style for each cell can be applied. The API also supports the capabilities to set Rich Text formatting for excel worksheet cells. The API offers Font class which provides the capabilities to specify the font information for specific cells. You can set formatting like Bold, Italic, Strikeout, SubScript, SuperScript, Underline, Size, FontName.
string MyAppKey = "xxxxxxxx"; // Get AppKey from https://dashboard.aspose.cloud/ | |
string MyAppSid = "xxxxxxxxx"; // Get AppSID from https://dashboard.aspose.cloud/ | |
// Complete examples can be found over https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet | |
// create an instance of Cells Cloud API | |
Aspose.Cells.Cloud.SDK.Api.CellsApi cellsApi = new Aspose.Cells.Cloud.SDK.Api.CellsApi(MyAppSid, MyAppKey); | |
string fileName = "NewBook2056160256i53.xlsx"; | |
String sheetName = "Sheet1"; | |
String cellName = "A3"; | |
Aspose.Cells.Cloud.SDK.Model.Style style = new Aspose.Cells.Cloud.SDK.Model.Style(); | |
Aspose.Cells.Cloud.SDK.Model.Font font = new Aspose.Cells.Cloud.SDK.Model.Font(); | |
font.IsBold = true; | |
font.Color = new Aspose.Cells.Cloud.SDK.Model.Color() { A = 10, R = 120, G = 200, B = 230 }; | |
font.Size = 16; | |
Aspose.Cells.Cloud.SDK.Model.ThemeColor themeColor = new Aspose.Cells.Cloud.SDK.Model.ThemeColor(); | |
themeColor.ColorType = "Text2"; | |
themeColor.Tint = 2; | |
style.BackgroundThemeColor = themeColor; | |
style.Font = font; | |
try | |
{ | |
// Invoke Aspose.Cells Cloud SDK API to change cell style | |
Aspose.Cells.Cloud.SDK.Model.StyleResponse apiResponse = cellsApi.CellsPostUpdateWorksheetCellStyle(fileName, sheetName, cellName, style); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Change Cell Style in Excel Worksheet, Done!"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |

Fig 1:- Cell formatting updated after code execution.
Related Articles
We also recommend visiting following articles for more information on: