Class XLHelper
Common methods
public static class XLHelper
- Inheritance
-
XLHelper
- Inherited Members
Fields
Epsilon
public const double Epsilon = 1E-10
Field Value
MaxColumnLetter
public const string MaxColumnLetter = "XFD"
Field Value
MaxColumnNumber
public const int MaxColumnNumber = 16384
Field Value
MaxRowNumber
public const int MaxRowNumber = 1048576
Field Value
MinColumnNumber
public const int MinColumnNumber = 1
Field Value
MinRowNumber
public const int MinRowNumber = 1
Field Value
NoBomUTF8
public static Encoding NoBomUTF8
Field Value
Properties
LastCell
public static string LastCell { get; }
Property Value
Methods
AreEqual(double, double)
public static bool AreEqual(double d1, double d2)
Parameters
Returns
CreateSafeSheetName(string, char)
Creates a valid sheet name, which conforms to the following rules. A sheet name: is never null, has minimum length of 1 and maximum length of 31, doesn't contain special chars: (: 0x0000 0x0003 / \ ? * ] [). Sheet names must not begin or end with ' (apostrophe)
public static string CreateSafeSheetName(string nameProposal, char replaceChar = ' ')
Parameters
nameProposalstringcan be any string, will be truncated if necessary, allowed to be null
replaceCharcharthe char to replace invalid characters.
Returns
- string
a valid string, "empty" if too short, "null" if null
GetColumnLetterFromNumber(int, bool)
Gets the column letter of a given column number.
public static string GetColumnLetterFromNumber(int columnNumber, bool trimToAllowed = false)
Parameters
columnNumberintThe column number to translate into a column letter.
trimToAllowedboolif set to
truethe column letter will be restricted to the allowed range.
Returns
GetColumnNumberFromAddress(string)
public static int GetColumnNumberFromAddress(string cellAddressString)
Parameters
cellAddressStringstring
Returns
GetColumnNumberFromLetter(string)
Gets the column number of a given column letter.
public static int GetColumnNumberFromLetter(string columnLetter)
Parameters
columnLetterstringThe column letter to translate into a column number.
Returns
GetDate(object)
public static DateTime GetDate(object v)
Parameters
vobject
Returns
IsValidA1Address(string)
public static bool IsValidA1Address(string address)
Parameters
addressstring
Returns
IsValidColumn(string)
public static bool IsValidColumn(string column)
Parameters
columnstring
Returns
IsValidRCAddress(string)
public static bool IsValidRCAddress(string address)
Parameters
addressstring
Returns
IsValidRangeAddress(IXLRangeAddress)
public static bool IsValidRangeAddress(IXLRangeAddress rangeAddress)
Parameters
rangeAddressIXLRangeAddress
Returns
IsValidRangeAddress(string)
public static bool IsValidRangeAddress(string rangeAddress)
Parameters
rangeAddressstring
Returns
IsValidRow(string)
public static bool IsValidRow(string rowString)
Parameters
rowStringstring
Returns
ValidateName(string, string, string, IEnumerable<string>, out string)
public static bool ValidateName(string objectType, string newName, string oldName, IEnumerable<string> existingNames, out string message)
Parameters
Returns
ValidateSheetName(string)
Validates the name of the sheet. The character count MUST be greater than or equal to 1 and less than or equal to 31. The string MUST NOT contain the any of the following characters:
- 0x0000
- 0x0003
- colon (:)
- backslash()
- asterisk(*)
- question mark(?)
- forward slash(/)
- opening square bracket([)
- closing square bracket(]) The string MUST NOT begin or end with the single quote(') character.
public static void ValidateSheetName(string sheetName)
Parameters
sheetNamestringName of the sheet.