CellsHelper

CellsHelper class

Provides helper functions.

Properties

NameTypeDescription
SignificantDigitsintGets and sets the number of significant digits. The default value is 17. Only could be 15 or 17 now.
SignificantDigitsTypeintThe value of the property is SignificantDigitsType integer constant.
DPIfloatGets the DPI of the machine.
StartupPathStringGets or sets the startup path, which is referred to by some external formula references.
AltStartPathStringGets or sets the alternate startup path, which is referred to by some external formula references.
LibraryPathStringGets or sets the library path which is referred to by some external formula references.
CustomImplementationFactoryCustomImplementationFactoryGets or sets the factory for creating instances with special implementation.
IsCloudPlatformbooleanPlease set this property True when running on a cloud platform, such as: Azure, AWSLambda, etc,

Methods

NameDescription
getTextWidthGet width of text in unit of points.
getVersionGet the release version.
cellNameToIndexGets the cell row and column indexes according to its name.
cellIndexToNameGets cell name according to its row and column indexes.
columnIndexToNameGets column name according to column index.
columnNameToIndexGets column index according to column name.
rowIndexToNameGets row name according to row index.
rowNameToIndexGets row index according to row name.
convertR1C1FormulaToA1Converts the r1c1 formula of the cell to A1 formula.

NOTE: This member is now obsolete. Instead, please use Worksheet.C | | convertA1FormulaToR1C1 | Converts A1 formula of the cell to the r1c1 formula.

NOTE: This member is now obsolete. Instead, please use Worksheet.C | | getDateTimeFromDouble | Convert the double value to the date time value. | | getDoubleFromDateTime | Convert the date time to double value. | | getUsedColors | Gets all used colors in the workbook. | | addAddInFunction | Add addin function.

NOTE: This member is now obsolete. Instead, please use WorksheetCollection.RegisterAddInFunction() | | mergeFiles | Merges some large xls files to a xls file.

This method only supports merging data, style and formulas to the new file. | | getCacheFolder | | | setCacheFolder | | | createSafeSheetName | Checks given sheet name and create a valid one when needed. If given sheet name conforms to the rules of excel sheet nam | | needQuoteInFormula | Indicates whether the name of the sheet should be enclosed in single quotes |

CellsHelper.SignificantDigits property

Gets and sets the number of significant digits. The default value is 17. Only could be 15 or 17 now.

Type: int

CellsHelper.SignificantDigitsType property

The value of the property is SignificantDigitsType integer constant.

Type: int

CellsHelper.DPI property

Gets the DPI of the machine.

Type: float

CellsHelper.StartupPath property

Gets or sets the startup path, which is referred to by some external formula references.

Type: String

CellsHelper.AltStartPath property

Gets or sets the alternate startup path, which is referred to by some external formula references.

Type: String

CellsHelper.LibraryPath property

Gets or sets the library path which is referred to by some external formula references.

Type: String

CellsHelper.CustomImplementationFactory property

Gets or sets the factory for creating instances with special implementation.

Type: CustomImplementationFactory

CellsHelper.IsCloudPlatform property

Please set this property True when running on a cloud platform, such as: Azure, AWSLambda, etc,

Type: boolean

getTextWidth(text, font, scaling)

Get width of text in unit of points.

ParameterTypeDescription
textStringThe text.
fontFontThe font of the text.
scalingfloatThe scaling of text.

getVersion()

Get the release version.

Returns: The release version.

cellNameToIndex(cellName)

Gets the cell row and column indexes according to its name.

ParameterTypeDescription
cellNameStringName of cell

Returns: [0] is the row index and [1] is the column index.

cellIndexToName(row, column)

Gets cell name according to its row and column indexes.

ParameterTypeDescription
rowintRow index.
columnintColumn index.

Returns: Name of cell.

columnIndexToName(column)

Gets column name according to column index.

ParameterTypeDescription
columnintColumn index.

Returns: Name of column.

columnNameToIndex(columnName)

Gets column index according to column name.

ParameterTypeDescription
columnNameStringColumn name.

Returns: Column index.

rowIndexToName(row)

Gets row name according to row index.

ParameterTypeDescription
rowintRow index.

Returns: Name of row.

rowNameToIndex(rowName)

Gets row index according to row name.

ParameterTypeDescription
rowNameStringRow name.

Returns: Row index.

convertR1C1FormulaToA1(r1c1Formula, row, column)

Converts the r1c1 formula of the cell to A1 formula.

NOTE: This member is now obsolete. Instead, please use Worksheet.ConvertFormulaReferenceStyle() method. This property will be removed 12 months later since August 2023. Aspose apologizes for any inconvenience you may have experienced.

ParameterTypeDescription
r1c1FormulaStringThe r1c1 formula.
rowintThe row index of the cell.
columnintThe column index of the cell.

Returns: The A1 formula.

convertA1FormulaToR1C1(formula, row, column)

Converts A1 formula of the cell to the r1c1 formula.

NOTE: This member is now obsolete. Instead, please use Worksheet.ConvertFormulaReferenceStyle() method. This property will be removed 12 months later since August 2023. Aspose apologizes for any inconvenience you may have experienced.

ParameterTypeDescription
formulaStringThe A1 formula.
rowintThe row index of the cell.
columnintThe column index of the cell.

Returns: The R1C1 formula.

getDateTimeFromDouble(doubleValue, date1904)

Convert the double value to the date time value.

ParameterTypeDescription
doubleValuefloatThe double value.
date1904booleanDate 1904 system.

getDoubleFromDateTime(dateTime, date1904)

Convert the date time to double value.

ParameterTypeDescription
dateTimeDateTimeThe date time.
date1904booleanDate 1904 system.

getUsedColors(workbook)

Gets all used colors in the workbook.

ParameterTypeDescription
workbookWorkbookThe workbook object.

Returns: The used colors.

addAddInFunction(function, minCountOfParameters, maxCountOfParameters, paramersType, functionValueType)

Add addin function.

NOTE: This member is now obsolete. Instead, please use WorksheetCollection.RegisterAddInFunction() methods. This method will be removed 12 months later since January 2022. Aspose apologizes for any inconvenience you may have experienced.

ParameterTypeDescription
functionStringThe function name.
minCountOfParametersintMinimum number of parameters this function requires
maxCountOfParametersintMaximum number of parameters this function allows.
paramersTypeNumber ArrayThe excepted parameters type of the function
functionValueTypeintA ParameterType value. The function value type.

mergeFiles(files, cachedFile, destFile)

Merges some large xls files to a xls file.

This method only supports merging data, style and formulas to the new file. The cached file is used to store some temporary data.

ParameterTypeDescription
filesString[]The files.
cachedFileStringThe cached file.
destFileStringThe dest file.

getCacheFolder()

setCacheFolder(cache)

createSafeSheetName(nameProposal) (1 of 2)

Checks given sheet name and create a valid one when needed. If given sheet name conforms to the rules of excel sheet name, then return it. Otherwise string will be truncated if length exceeds the limit and invalid characters will be replaced with ’ ‘, then return the rebuilt string value.

ParameterTypeDescription
nameProposalStringsheet name to be used

createSafeSheetName(nameProposal, replaceChar) (2 of 2)

Checks given sheet name and create a valid one when needed. If given sheet name conforms to the rules of excel sheet name, then return it. Otherwise string will be truncated if length exceeds the limit and invalid characters will be replaced with given character, then return the rebuilt string value.

ParameterTypeDescription
nameProposalStringsheet name to be used
replaceCharcharcharacter which will be used to replace invalid characters in given sheet name

needQuoteInFormula(sheetName)

Indicates whether the name of the sheet should be enclosed in single quotes

ParameterTypeDescription
sheetNameStringThe name of the sheet