ExcelFile Class
Interface a FlexCel engine has to implement to be used with FlexCelReport.
Remarks
This is an abstract class encapsulating the FlexCel API. Any implementation on the API must derive from this class.
FlexCel provides an implementation of this interface on the class XlsFile.
Syntax
Namespace: FlexCel.Core
public abstract class ExcelFile: IFlexCelFontList, IEmbeddedObjects, IFlexCelPalette, IRowColSize, IEnumerable<CellValue>
Fields
Name | Description |
---|---|
FIsLightClone | If true, this class was created by cloning another. This field is only used when creating a descendant of this class. For normal cases use IsLightClone |
SupportsXlsx | This property lets you know if the version of FlexCel.dll you are using supports XLSX file format. Currently XLSX is supported in all versions. |
Constructors
Name | Description |
---|---|
ExcelFile | Initializes ExcelFile fields. |
Methods
Name | Description |
---|---|
EncodingNotNull | Returns UTF8 if the parameter is null. |
CheckRangeObjPathOrImageIndex | Checks that a range or path are between bounds. Internal use. |
AddWindow | Adds a new window to the file. Note that this isn't a new sheet, but another view of the workbook. Most Excel documents have only one window. |
DeleteWindow | Deletes a window from the file. Note that this isn't a sheet, but another view of the workbook. Most Excel documents have only one window. |
OnVirtualCellRead | Replace this method if you want to override this event in a derived class. |
OnVirtualCellStartReading | Replace this method if you want to override this event in a derived class. |
OnVirtualCellEndReading | Replace this method if you want to override this event in a derived class. |
NewFile | Overloaded NewFile NewFile(Int32) NewFile(Int32, TExcelFileFormat) |
Open | Overloaded Open(String) Open(Stream) Open(String, TFileFormats, Char, Int32, Int32, ColumnImportType[]) Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[], Boolean) Open(String, TFileFormats, Char, Int32, Int32, ColumnImportType[], Encoding, Boolean) Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[], Encoding, Boolean) Open(String, TFileFormats, Char, Int32, Int32, ColumnImportType[], String[], Encoding, Boolean) Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[], String[], Encoding, Boolean) |
Import | Overloaded Import(TextReader, Int32, Int32, Int32[], ColumnImportType[]) Import(TextReader, Int32, Int32, Int32[], ColumnImportType[], String[]) Import(String, Int32, Int32, Char, ColumnImportType[], Encoding, Boolean) Import(Stream, Int32, Int32, Char, ColumnImportType[], Encoding, Boolean) Import(TextReader, Int32, Int32, Char, Char, ColumnImportType[], String[]) Import(String, Int32, Int32, Int32[], ColumnImportType[], Encoding, Boolean) Import(Stream, Int32, Int32, Int32[], ColumnImportType[], Encoding, Boolean) Import(String, Int32, Int32, Char, ColumnImportType[], String[], Encoding, Boolean) Import(Stream, Int32, Int32, Char, ColumnImportType[], String[], Encoding, Boolean) Import(String, Int32, Int32, Int32[], ColumnImportType[], String[], Encoding, Boolean) Import(Stream, Int32, Int32, Int32[], ColumnImportType[], String[], Encoding, Boolean) Import(String, Int32, Int32, Char, Char, ColumnImportType[], String[], Encoding, Boolean) Import(Stream, Int32, Int32, Char, Char, ColumnImportType[], String[], Encoding, Boolean) |
Save | Overloaded Save(String) Save(Stream) Save(String, TFileFormats) Save(Stream, TFileFormats) Save(String, TFileFormats, Char) Save(Stream, TFileFormats, Char) Save(String, TFileFormats, Char, Encoding) Save(Stream, TFileFormats, Char, Encoding) |
Export | Overloaded Export(TextWriter, TXlsCellRange, Char, Boolean) Export(String, TXlsCellRange, Char, Boolean, Encoding) Export(Stream, TXlsCellRange, Char, Boolean, Encoding) Export(TextWriter, TXlsCellRange, Char, Boolean, String) Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean) Export(String, TXlsCellRange, Int32, Int32[], Boolean, Encoding) Export(Stream, TXlsCellRange, Int32, Int32[], Boolean, Encoding) Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean, Boolean) Export(String, TXlsCellRange, Int32, Int32[], Boolean, Encoding, Boolean) Export(Stream, TXlsCellRange, Int32, Int32[], Boolean, Encoding, Boolean) Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean, Boolean, String) |
SaveForHashing | Overloaded SaveForHashing(Stream) SaveForHashing(Stream, TExcludedRecords) |
GetSheetIndex | Overloaded GetSheetIndex(String) GetSheetIndex(String, Boolean) |
GetSheetName | Returns the sheet name for a given index. To change the active sheet by the name, use ActiveSheetByName. See also GetSheetIndex(String) |
GetSheetIndexFromID | Returns the ActiveSheet for a stored SheetID. You can use this method together with SheetID to save and restore an ActiveSheet when you are adding or removing sheets. If the sheet ID doesn't exist, this method will return 0. |
GetSheetVisible | Returns if a given sheet is visible. |
AddSheet | Inserts an empty sheet at the end of the file. This is equivalent to calling InsertAndCopySheets(0, SheetCount + 1, 1). If you need to insert more than one sheet, or insert it at the middle of existing sheets, use InsertAndCopySheets(Int32, Int32, Int32) instead. |
AddChartSheet | Adds a chart sheet to the file. You can then add series and customize the returned ExcelChart object. Note that as this is a chart sheet, the anchor is ignored. The ActiveSheet after adding the chart will be set to the newly inserted chart. Important: This method only works in xlsx files. |
InsertAndCopySheets | Overloaded InsertAndCopySheets(Int32, Int32, Int32) InsertAndCopySheets(Int32[], Int32, ExcelFile) InsertAndCopySheets(Int32, Int32, Int32, ExcelFile) |
ClearSheet | Clears all data on the active sheet, but does not delete it. |
DeleteSheet | Overloaded DeleteSheet(Int32) DeleteSheet(String) DeleteSheet(Int32, Int32) |
GetSheetSelected | Returns true if a sheet is selected, false otherwise. Note that you might select many sheets in Excel by shift or ctrl-clicking the sheet tabs. Also note that when changing the ActiveSheet, the sheet selected will be reset to the active sheet. So if you want to find out which sheets are selected in a file, you should call this method after opening the file but before changing the active sheet. This property can work in different windows depending on the value of ActiveWindow...[more] |
SetSheetSelected | This method will set a sheet tab as selected. Note that this is different from ActiveSheet in that you might have only a single active sheet, but you might select many tabs by ctrl-clicking them. Also note that whenever you change the ActiveSheet, the selected sheets will be reset to the active sheet only. So if you want to save a file with more than one selected sheet, you should call this method after the last call to activesheet. This property can work in different windows depending on the value of...[more] |
GetSheetType | Returns the sheet type for a given sheet. |
HasHPageBreak | True if the sheet has a Manual Horizontal page break on the row. |
HasVPageBreak | True if the sheet has a Manual Vertical page break on the column. |
InsertHPageBreak | Overloaded InsertHPageBreak(Int32) InsertHPageBreak(Int32, Boolean) |
InsertVPageBreak | Overloaded InsertVPageBreak(Int32) InsertVPageBreak(Int32, Boolean) |
DeleteHPageBreak | Deletes all manual page breaks at row. If there is no manual page break on row, this method will do nothing. |
DeleteVPageBreak | Deletes all manual page breaks at col. If there is no manual page break on col, this method will do nothing. |
ClearPageBreaks | Deletes all manual page breaks on the active sheet. |
KeepRowsTogether | Tells FlexCel that it must try to keep together the rows between row1 and row2 (inclusive) when printing. This method does nothing to the resulting Excel file since this is not an Excel feature. To actually do something, you need to call AutoPageBreaks after calling this method. |
KeepColsTogether | Tells FlexCel that it must try to keep together the columns between col1 and col2 (inclusive) when printing. This method does nothing to the resulting Excel file since this is not an Excel feature. To actually do something, you need to call AutoPageBreaks after calling this method. |
ClearKeepRowsAndColsTogether | Clears all the "KeepTogether" links in the current page. |
GetKeepRowsTogether | Returns the value of level for a row as set in KeepRowsTogether. Note that the last value of a "keep together" range is 0. For example, if you set KeepRowsTogether(1, 3, 8, true); GetKeepRowsTogether will return 8 for rows 1 and 2, and 0 for row 3. |
GetKeepColsTogether | Returns the value of level for a column as set in KeepColsTogether. Note that the last value of a "keep together" range is 0. For example, if you set KeepColsTogether(1, 3, 8, true); GetKeepColsTogether will return 8 for columns 1 and 2, and 0 for column 3. |
HasKeepRowsTogether | Returns true if there is any row marked as keeptogether in the sheet. This method traverses every row to find out, so it can be somehow slow and you should not call it too often. |
HasKeepColsTogether | Returns true if there is any column marked as keeptogether in the sheet. This method traverses every column to find out, so it can be somehow slow and you should not call it too often. |
DumpKeepRowsTogetherLevels | This method is used for debugging intelligent page breaks (see 'Intelligent page breaks' in the Api Developer Guide. It will read the keep-together level for every row ad write it at the column "col". Note that the contents of col will be overwritten. |
DumpKeepColsTogetherLevels | This method is used for debugging intelligent page breaks (see 'Intelligent page breaks' in the Api Developer Guide. It will read the keep-together level for every column and writer it the row "row". Note that the contents of row will be overwritten. |
AutoPageBreaks | Overloaded AutoPageBreaks AutoPageBreaks(Int32, Int32) AutoPageBreaks(Int32, TUIRectangle) |
GetCellValue | Overloaded GetCellValue(String) GetCellValue(Int32, Int32) GetCellValue(Int32, Int32, Int32) GetCellValue(Int32, Int32, Int32, Int32) |
GetCellValueIndexed | Overloaded GetCellValueIndexed(Int32, Int32, Int32) GetCellValueIndexed(Int32, Int32, Int32, Int32) |
SetCellValue | Overloaded SetCellValue(String, Object) SetCellValue(Int32, Int32, Object) SetCellValue(Int32, Int32, Object, Int32) SetCellValue(Int32, Int32, Int32, Object, Int32) |
ConvertString | Overloaded ConvertString(TRichString, Int32) ConvertString(TRichString, Int32, String[]) |
SetCellFromString | Overloaded SetCellFromString(Int32, Int32, String) SetCellFromString(Int32, Int32, TRichString) SetCellFromString(String, String, String[]) SetCellFromString(Int32, Int32, String, String[]) SetCellFromString(Int32, Int32, TRichString, String[]) SetCellFromString(Int32, Int32, String, Int32) SetCellFromString(Int32, Int32, TRichString, Int32) SetCellFromString(Int32, Int32, String, Int32, String[]) SetCellFromString(Int32, Int32, TRichString, Int32, String[]) SetCellFromString(Int32, Int32, Int32, TRichString, Int32, String[]) |
GetStringFromCell | Overloaded GetStringFromCell(String) GetStringFromCell(Int32, Int32) GetStringFromCell(Int32, Int32, Boolean) GetStringFromCell(Int32, Int32, Int32, TUIColor) GetStringFromCell(Int32, Int32, Int32, Int32, TUIColor) GetStringFromCell(Int32, Int32, Int32, Int32, TUIColor, Boolean) |
SetCellFromHtml | Overloaded SetCellFromHtml(Int32, Int32, String) SetCellFromHtml(Int32, Int32, String, Int32) |
GetHtmlFromCell | Overloaded GetHtmlFromCell(Int32, Int32, THtmlVersion, THtmlStyle, Encoding) GetHtmlFromCell(Int32, Int32, THtmlVersion, THtmlStyle, Encoding, Boolean) |
CopyCell | Copies one cell from one workbook to another. If the cell has a formula, it will be offset so it matches the new destination. Note: You will normally not need this method. To copy a range of cells from a workbook to another use InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode, TRangeCopyMode, ExcelFile, Int32)...[more] |
GetFormat | Returns the format definition for a given format index. Note that this method will only return Cell formats. If you want to read a Style format, use GetStyle(Int32) |
AddFormat | Adds a new format to the Excel format list. If it already exists, it doesn't add a new one, so you can use this method for searching too. |
SetFormat | Sets the font definition for a given format index. Normally it is of not use, (you should use AddFont or AddFormat instead) but could be used to change the default format. (using SetFormat(0, fmt); ). This method will change style XFs and CellXfs, depending if aFormat is a StyleXF or a CellXF. |
GetFont | Returns the font definition for a given font index. |
SetFont | Sets the font definition for a given font index. Normally it is of not use, (you should use AddFont or AddFormat instead) but could be used to change the default font format. (using SetFont(0, font); ) |
AddFont | Adds a new font to the excel font list. If it already exists, it doesn't add a new one, so you can use this method for searching too. |
SetCellFormat | Overloaded SetCellFormat(Int32, Int32, Int32) SetCellFormat(Int32, Int32, Int32, Int32, Int32) SetCellFormat(Int32, Int32, Int32, Int32, TFlxFormat, TFlxApplyFormat) SetCellFormat(Int32, Int32, Int32, Int32, TFlxFormat, TFlxApplyFormat, Boolean) |
DrawBorders | This method draws a border around a range of cells. |
GetCellFormat | Overloaded GetCellFormat(Int32, Int32) GetCellFormat(Int32, Int32, Int32) |
GetCellVisibleFormat | Overloaded GetCellVisibleFormat(Int32, Int32) GetCellVisibleFormat(Int32, Int32, Int32) |
GetCellVisibleFormatDef | Overloaded GetCellVisibleFormatDef(Int32, Int32) GetCellVisibleFormatDef(Int32, Int32, Int32) |
ConditionallyModifyFormat | Overloaded ConditionallyModifyFormat(TFlxFormat, Int32, Int32, TDrawingConditionalFormat) ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat) |
AddConditionalFormat | Adds a conditional format for a range of cells. |
SetConditionalFormat | Modifies one of the conditional format rules in the sheet. |
GetConditionalFormat | One of the entries on the conditional format list of this file. |
RemoveConditionalFormat | Removes the conditional format at position index. |
ClearConditionalFormatsInSheet | Removes all conditional formats in the active sheet. |
GetStyleName | Gets the name of the style at position index. (1 based). |
GetStyle | Overloaded GetStyle(Int32) GetStyle(String) GetStyle(String, Boolean) |
RenameStyle | Renames an existing style. Note that this might be a user-defined style, you can't rename built-in styles. |
SetStyle | Modifies an existing style if name already exists, or creates a new style if it doesn't. |
DeleteStyle | Returns a named style for the workbook. |
GetBuiltInStyleName | Returns the name for a built-in style. |
TryGetBuiltInStyleType | Tries to convert a string into an built-in style identifier. Will return true if styleName can be converted, false otherwise. |
CellMergedBounds | Merged Range where the cell is. |
MergeCells | Merges a number of cells into one. |
UnMergeCells | Unmerges the range of cells. The coordinates have to be exact, if there is no merged cell with the exact coordinates, nothing will be done. If you want to unmerge all cells inside a range, use UnMergeAllCellsInRange instead. |
UnMergeAllCellsInRange | This method will unmerge all the cells that are inside a range of cells. |
CellMergedList | The Merged cell at position index on the mergedcell list. |
CellMergedNext | Use this method to enumerate all merged cells in a sheet. |
GetRowCount | Number of rows actually used on a given sheet. |
GetColCount | Overloaded GetColCount(Int32) GetColCount(Int32, Boolean) |
IsEmptyRow | True if the specified row does not have any cells, nor any format on it. In short, this row has never been used. |
IsNotFormattedCol | True if the specified column does not have any format applied on it. |
GetRowFormat | Overloaded GetRowFormat(Int32) GetRowFormat(Int32, Int32) |
SetRowFormat | Overloaded SetRowFormat(Int32, Int32) SetRowFormat(Int32, Int32, Boolean) SetRowFormat(Int32, TFlxFormat, TFlxApplyFormat, Boolean) |
GetColFormat | Overloaded GetColFormat(Int32) GetColFormat(Int32, Int32) |
SetColFormat | Overloaded SetColFormat(Int32, Int32) SetColFormat(Int32, Int32, Boolean) SetColFormat(Int32, Int32, Int32) SetColFormat(Int32, Int32, Int32, Boolean) SetColFormat(Int32, TFlxFormat, TFlxApplyFormat, Boolean) |
GetRowOptions | Returns all Row options at once (if the row is autosize, if it is hidden, etc). |
SetRowOptions | Sets all Row options at once (if the row is autosize, if it is hidden, etc). |
GetColOptions | Returns all Column options at once (if the column is hidden, etc). |
SetColOptions | Sets all Column options at once (if the column is hidden, etc). |
GetRowHeight | Overloaded GetRowHeight(Int32) GetRowHeight(Int32, Boolean) GetRowHeight(Int32, Int32, Boolean) |
SetRowHeight | Sets the current Row height, in Excel internal units. (1/20th of a point) See Excel Internal Units for more information in Excel internal units. |
GetColWidth | Overloaded GetColWidth(Int32) GetColWidth(Int32, Boolean) GetColWidth(Int32, Int32, Boolean) |
SetColWidth | Overloaded SetColWidth(Int32, Int32) SetColWidth(Int32, Int32, Int32) |
DefaultRowHeightVisual | The default height for empty rows, in Excel internal units. (1/20th of a point). Different from DefaultRowHeight this property returns the actual row height as Excel will show it, considering DefaultRowHidden and DefaultRowHeightAutomatic. See Excel Internal Units for more information in Excel internal units. |
GetRowHidden | Overloaded GetRowHidden(Int32) GetRowHidden(Int32, Int32) |
SetRowHidden | Hides or shows a specific row. |
GetColHidden | Returns true if the column is hidden. |
SetColHidden | Overloaded SetColHidden(Int32, Boolean) SetColHidden(Int32, Int32, Boolean) |
GetAutoRowHeight | Returns if the row is adjusting its size to the cell (the default) or if it has a fixed height. |
SetAutoRowHeight | Sets the current row to automatically autosize to the biggest cell or not. |
AutofitRow | Overloaded AutofitRow(Int32, Boolean, Double) AutofitRow(Int32, Int32, Boolean, Boolean, Double) AutofitRow(Int32, Int32, Boolean, Boolean, Double, Int32, Int32, Int32) AutofitRow(Int32, Int32, Boolean, Boolean, Double, Int32, Int32, Int32, TAutofitMerged) AutofitRow(Int32, Int32, Int32, Int32, Boolean, Boolean, Double, Int32, Int32, Int32, TAutofitMerged) |
AutofitCol | Overloaded AutofitCol(Int32, Boolean, Double) AutofitCol(Int32, Int32, Boolean, Double) AutofitCol(Int32, Int32, Boolean, Double, Int32, Int32, Int32) AutofitCol(Int32, Int32, Boolean, Double, Int32, Int32, Int32, TAutofitMerged) AutofitCol(Int32, Int32, Int32, Int32, Boolean, Double, Int32, Int32, Int32, TAutofitMerged) |
AutofitRowsOnWorkbook | Overloaded AutofitRowsOnWorkbook(Boolean, Boolean, Double) AutofitRowsOnWorkbook(Boolean, Boolean, Double, Int32, Int32, Int32) AutofitRowsOnWorkbook(Boolean, Boolean, Double, Int32, Int32, Int32, TAutofitMerged) |
MarkRowForAutofit | Overloaded MarkRowForAutofit(Int32, Boolean, Double) MarkRowForAutofit(Int32, Boolean, Double, Int32, Int32, Int32, Boolean) |
MarkColForAutofit | Overloaded MarkColForAutofit(Int32, Boolean, Double) MarkColForAutofit(Int32, Boolean, Double, Int32, Int32, Int32, Boolean) |
IsRowMarkedForAutofit | Returns true is a row is marked for autofit. |
IsColMarkedForAutofit | Returns true is a column is marked for autofit. |
AutofitMarkedRowsAndCols | Overloaded AutofitMarkedRowsAndCols(Boolean, Boolean, Double) AutofitMarkedRowsAndCols(Boolean, Boolean, Double, Int32, Int32, Int32, Int32, Int32) AutofitMarkedRowsAndCols(Boolean, Boolean, Double, Int32, Int32, Int32, Int32, Int32, TAutofitMerged) |
AutofitComment | Will return the resized anchor so the size of the comment is enough to fit all the text inside. |
ColCountInRow | Overloaded ColCountInRow(Int32) ColCountInRow(Int32, Int32) |
ColFromIndex | Overloaded ColFromIndex(Int32, Int32) ColFromIndex(Int32, Int32, Int32) |
ColToIndex | Overloaded ColToIndex(Int32, Int32) ColToIndex(Int32, Int32, Int32) |
LoopOverUsedRange | This method loops over a range of cells, and calls an action for every cell that has data. |
CopyColFormats | Copies the column definitions, that is formats, widths, hidden/visible, etc from one workbook or sheet to another. |
GetColumnBlocks | This method returns a list of blocks of column information, grouped by columns that have the same properties. Since an xlsx file can have 16384 columns, querying every one of them might be slow. With this method, if columns from 5 to 16384 are hidden, you will get a single block with firstCol = 5 and lastCol = 16384 that is hidden. If you used GetColHidden instead you would have to call it 16384 times to get the same information. |
SetColorPalette | Changes a color on the Excel color palette. |
GetColorPalette | Overloaded GetColorPalette(Int32) GetColorPalette(Int32, TUIColor) |
NearestColorIndex | Overloaded NearestColorIndex(TUIColor) NearestColorIndex(TUIColor, Boolean[]) |
PaletteContainsColor | Returns true if the internal color palette contains the exact specified color. Note that Excel 2007 doesn't use the color palette, so this method is not needed there. |
OptimizeColorPalette | Changes the colors in the color palette so they can represent better the colors in use. This method will change the colors not used in the palette by colors used in the sheet. If there are more unique colors in the sheet than the 56 available in the palette, only the first colors will be changed. When FlexCel saves an xls file, it saves the color information twice: The real color for Excel 2007 and newer, and the indexed color for older Excel versions. This method optimizes the palette of indexed colors so they look better in Excel 2003 or older. It doesn't effect Excel 2007 or newer at all. |
GetColorPaletteVersion | Internal use. Every time the palette changes, the number returned is incremented. |
SetColorTheme | Overloaded SetColorTheme(TThemeColor, TDrawingColor) SetColorTheme(TPrimaryThemeColor, TDrawingColor) |
GetColorTheme | Overloaded GetColorTheme(TThemeColor) GetColorTheme(TPrimaryThemeColor) |
NearestColorTheme | Returns the most similar entry on the theme palette for a given color. |
GetThemeFont | Gets the major of minor font scheme in the theme. |
SetThemeFont | Sets either the minor or the major font for the theme. |
GetTheme | This is an advanced method, that allows you to get the full theme in use. Normally you will just want to replace colors, and you can do this with SetColorTheme(TPrimaryThemeColor, TDrawingColor) and GetColorTheme(TPrimaryThemeColor) methods. Much of the functionality in a theme applies to PowerPoint, not Excel....[more] |
GetThemeNoClone | Internal use. This won't clone the internal structure for more performance. |
SetTheme | This is an advanced method, that allows you to set the full theme in use. Normally you will just want to replace colors, and you can do this with SetColorTheme(TPrimaryThemeColor, TDrawingColor) and GetColorTheme(TPrimaryThemeColor) methods. |
GetNamedRange | Overloaded GetNamedRange(Int32) GetNamedRange(String, Int32) GetNamedRange(String, Int32, Int32) |
FindNamedRange | Returns the index (1 based) on the list of named ranges for a given name and local sheet. If the range is not found, this method will return -1 You could use GetNamedRange(Int32) to get the name definition, or directly call GetNamedRange(String, Int32, Int32) to get a named range knowing its name and sheet position. |
SetNamedRange | Overloaded SetNamedRange(TXlsNamedRange) SetNamedRange(Int32, TXlsNamedRange) |
DeleteNamedRange | Deletes the name at the specified position. Important: If the name you are trying to delete is referenced by any formula/chart/whatever in your file, the name will not actually be deleted but hidden. You won't see the name in Excel or in the formula, but it will be there and you can see it from FlexCel. You can use GetUsedNamedRanges to learn if a range might be deleted. Also, note that if you later delete the formulas that reference those ranges FlexCel will remove those hanging ranges when saving....[more] |
GetUsedNamedRanges | Returns an array of booleans where each value indicates if the name at position "i-1" is used by any formula, chart, or object in the file. If the name is in use, it can't be deleted. Note that the index here is Zero-based, different from all other Name indexes in FlexCel, because arrays in C# are always 0-based. So UsedRange[0] corresponds to GetNamedRange(1) and so on. |
CopyToClipboard | Overloaded CopyToClipboard(StringBuilder, Stream) CopyToClipboard(FlexCelClipboardFormat, Stream) |
CopyToClipboardFormat | Overloaded CopyToClipboardFormat(TXlsCellRange, StringBuilder, Stream) CopyToClipboardFormat(FlexCelClipboardFormat, TXlsCellRange, Stream) |
PasteFromXlsClipboardFormat | Overloaded PasteFromXlsClipboardFormat(Int32, Int32, TFlxInsertMode, Stream) PasteFromXlsClipboardFormat(Int32, Int32, TFlxInsertMode, Stream, Boolean) |
PasteFromTextClipboardFormat | Pastes the clipboard contents beginning on cells row, col. |
GetPageHeaderAndFooter | This method will return all the headers and footers in a sheet. |
SetPageHeaderAndFooter | This method will set all the headers and footers in a sheet. If you want a simple header or footer for all the pages, you might want to use PageHeader and PageFooter |
FillPageHeaderOrFooter | Given a Page Header or footer string including macros (like [FileName] or [PageNo]), this method will return the strings that go into the left, right and middle sections. |
GetPageHeaderOrFooterAsHtml | Converts a section of a page header or footer into an HTML string. |
GetHeaderOrFooterImage | Overloaded GetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, TXlsImgType, Stream) GetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, TXlsImgType) |
GetHeaderOrFooterImageProperties | Returns the image position and size. |
SetHeaderOrFooterImage | Overloaded SetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, Byte[], THeaderOrFooterImageProperties) SetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, Byte[], TXlsImgType, THeaderOrFooterImageProperties) |
GetPrintMargins | Gets the Margins on the active sheet. |
SetPrintMargins | Sets the Margins on the active sheet. |
GetPrinterDriverSettings | Returns printer driver settings. This method is not intended to be used alone, but together with SetPrinterDriverSettings to copy printer driver information from a file to another. |
SetPrinterDriverSettings | Sets printer driver information. This method is not intended to be used alone, but together with GetPrinterDriverSettings to copy printer driver information from a file to another. |
SetImage | Overloaded SetImage(Int32, Byte[]) SetImage(Int32, TUIImage) SetImage(Int32, Byte[], TXlsImgType) SetImage(Int32, Byte[], Boolean, String) SetImage(Int32, TUIImage, Boolean, String) SetImage(Int32, Byte[], TXlsImgType, Boolean, String) |
SetImageAlternate | Sets the image data and / or image properties of an existing image. Currently this method is only needed for SVG images, since SVG images are stored as both PNG and SVG inside the xlsx file. This method allows you to supply both images. |
SetImageProperties | Overloaded SetImageProperties(Int32, TImageProperties) SetImageProperties(Int32, TImageProperties, Boolean, String) |
GetImageName | Overloaded GetImageName(Int32) GetImageName(Int32, Boolean, String) |
GetImage | Overloaded GetImage(Int32, TXlsImgType) GetImage(Int32, TXlsImgType, Stream) GetImage(Int32, String, TXlsImgType, Stream, Boolean) |
GetImageAlternate | Returns an image and its type. Currently this method is the same as GetImage(Int32, String, TXlsImgType, Stream, Boolean) for all images except SVG. For SVG images, xlsx files store both a PNG and SVG image. In those cases, this method will return the SVG image. To get the PNG, call GetImage(Int32, String, TXlsImgType, Stream, Boolean)...[more] |
HasImageAlternate | Returns true if the image has an alternate representation. This currently happens only with SVG images, which have a PNG base and an SVG alternate. If the image has an alternate, you can get the data with GetImageAlternate |
GetImageProperties | Overloaded GetImageProperties(Int32) GetImageProperties(Int32, Boolean, String) |
AddImage | Overloaded AddImage(TUIImage, TImageProperties) AddImage(Byte[], TImageProperties) AddImage(Stream, TImageProperties) AddImage(String, TImageProperties) AddImage(Byte[], TXlsImgType, TImageProperties) AddImage(Stream, TXlsImgType, TImageProperties) AddImage(Int32, Int32, TUIImage) |
AddImageAlternate | Adds an image to the active sheet. Currently this method is only needed for SVG images, since SVG images are stored as both PNG and SVG inside the xlsx file. This method allows you to supply both images. |
DeleteImage | Overloaded DeleteImage(Int32) DeleteImage(Int32, Boolean, String) |
ClearImage | Overloaded ClearImage(Int32) ClearImage(Int32, Boolean, String) |
SetSheetBackground | Sets the sheet background for the active sheet. Set it to null to remove the background. |
GetSheetBackground | Gets the sheet background for the active sheet. It will return null if there isn't any background in the sheet. |
ImageIndexToObjectIndex | Returns the general index on the object list for an image. You can use then this index on SendToBack, for example. Note that if the image is in a group, this method will return the first object index for the group that contains the image. If you want to get the object path to the image instead, look at ImageIndexToObjectPath |
ObjectIndexToImageIndex | Returns the index on the image collection of an object. Note that this method is slow when there are many images, so use it sparingly. |
ImageIndexToObjectPath | Returns the absolute object path for an image, given an image index. Note that this method can be slow if there are many objects in the file. Whenever possible, prefer the methods that take directly an imageIndex instead of converting the imageIndex to an objectPath. |
ObjectPathToImageIndex | Returns the index on the image collection of an object. Note that this method is slow when there are many images, so use it sparingly. Whenever possible, prefer the methods that take directly an objectPath instead of converting the objectPath to an imageIndex. |
GetObjectName | Returns the name of the object at objectIndex position. |
GetObjectShapeId | Returns the shape id of the object at objectIndex position. Shape Ids are internal identifiers for the shape, that you can use to uniquely identify a shape. Note that the shape id can change when you load the file, once it is loaded, it will remain the same for the shape lifetime. |
FindObject | Returns the object index for an existing name. Whenever possible you should prefer to use FindObjectPath instead of this method, since it is faster and finds also objects that are not in the root branch. |
FindObjectPath | Finds an object by its name, and returns the ObjectPath you need to use this object. Note that if there is more than an object with the same name in the sheet, this method will return null. |
FindObjectByShapeId | Finds an object given its internal shape id, and returns the object index you need to access the same object in FlexCel. |
IsValidObjectPathObjName | Returns true if the object name exists and it is unique in the sheet. You can use FindObjectPath to find the object path you need for this object name. |
GetObjectAnchor | Overloaded GetObjectAnchor(Int32) GetObjectAnchor(Int32, String) |
SetObjectAnchor | Overloaded SetObjectAnchor(Int32, TClientAnchor) SetObjectAnchor(Int32, String, TClientAnchor) |
GetObjectProperties | Overloaded GetObjectProperties(Int32, Boolean) GetObjectProperties(Int32, String, Boolean) |
GetObjectPropertiesByShapeId | Returns information on an object and all of its children and parents. Note: This method always returns a top level object. If you ask for a shape id of a shape that is contained inside other group, this method will return the first level group containing other groups that contain the shape. Note 2:This method is mostly for internal use. Shape ids are not guaranteed to be preserved when saving and reloading a file, so this method should only be used while editing the file with shape ids retrieved from the XlsFile object, not hardcoded shape ids. To get the object properties for a known shape in a file, give it a name and call...[more] |
SetObjectText | Overloaded SetObjectText(Int32, String, String) SetObjectText(Int32, String, TRichString) SetObjectText(Int32, String, TDrawingRichString) |
SetObjectName | Sets the name for an autoshape. |
SetObjectProperty | Overloaded SetObjectProperty(Int32, String, TShapeOption, String) SetObjectProperty(Int32, String, TShapeOption, Int64) SetObjectProperty(Int32, String, TShapeOption, Double) SetObjectProperty(Int32, String, TShapeOption, Boolean) SetObjectProperty(Int32, String, TShapeOption, TDrawingHyperlink) SetObjectProperty(Int32, String, TShapeOption, Int32, Boolean) |
SetObjectProperties | Sets all the properties of the shape. This allows for more complete control than SetObjectProperty(Int32, String, TShapeOption, String) beause it can specify for example a xlsx fill using a theme color, instead of simple RGB fills. |
AddAutoShape | Adds an autoshape to the sheet. You can add shapes to a worksheet, or to a chart sheet. For an example on how to add a shape, please create a shape in Excel, then open the file with APIMate and look at the generated code. |
DeleteObject | Overloaded DeleteObject(Int32) DeleteObject(Int32, String) |
GetObjectsInRange | Returns a list with all the objects that are completely inside a range of cells. |
GetObjectLinkedCell | Returns the cell that is linked to the object. If the object isn't an object that can be linked or it isn't linked, this method will return null. Note that when you change the value in the cell linked to this object, the value of the object will change. The sheet returned in the TCellAddress might be null, in which case the reference is to a cell in the same sheet, or it might contain another sheet name. Also note that this applies to form objects. To get the link of a shape like a circle or rectangle, use...[more] |
SetObjectLinkedCell | Links the object to a cell, if the object can be linked. If the object is a radio button then all the other radio buttons in the group will be linked to the same cell, so when the cell changes the radio buttons too, and vice-versa. To unlink the cell, make linkedCell null. |
GetShapeLinkedCell | Returns the cell that is linked to the shape or image. If the object isn't linked, this method will return null. Note that when you change the value in the cell linked to this object, the value of the object will change. Also note that this method applies to shapes like a rectangle or circle, or an image. To get the link of a forms object like a combobox or a radiobutton use GetObjectLinkedCell instead. |
SetShapeLinkedCell | Links the shape or image to a cell, if the shape can be linked. To unlink the cell, make linkedCell null. Note that this method applies to shapes like a rectangle or circle, or images. To change the link of a forms object like a combobox or a radiobutton use SetObjectLinkedCell instead. |
GetObjectInputRange | Returns the input range for the object. If the object isn't a combobox or listbox, or it doesn't have an input range, this method will return null. Note that when you change the value in the cell linked to this object, the value of the object will change. The sheet in the TCellAddresses returned might be null, in which case the reference is to a cell in the same sheet, or it might contain another sheet name. |
SetObjectInputRange | Sets the input range for a ListBox or a ComboBox. When applied to other objects, this method does nothing. |
GetObjectMacro | Returns the macro associated with an object, or null if there is no macro associated. |
SetObjectMacro | Associates an object with a macro. While this will normally be used in buttons, you can associate macros to almost any object. |
GetCheckboxState | Gets the value of a checkbox in the active sheet. Note that this only works for checkboxes added through the Forms toolbar. It won't return the values of ActiveX checkboxes. |
SetCheckboxState | Sets the value of a checkbox in the active sheet. Note that this only works for checkboxes added through the Forms toolbar. It won't return the values of ActiveX checkboxes. |
GetCheckboxLinkedCell | OBSOLETE: Use GetObjectLinkedCell instead. Returns the cell that is linked to the checkbox. If the object isn't a checkbox or it isn't linked, this method will return null. Note that when you change the value in the cell linked to this checkbox, the value of the checkbox will change. The sheet returned in the TCellAddress might be null, in which case the reference is to a cell in the same sheet, or it might contain another sheet name. |
SetCheckboxLinkedCell | OBSOLETE: Use SetObjectLinkedCell instead. Links the checkbox to a cell, so when the cell changes the checkbox changes too, and vice-versa. To unlink the cell, make linkedCell null. |
AddCheckbox | Overloaded AddCheckbox(TClientAnchor, TRichString, TCheckboxState, TCellAddress) AddCheckbox(TClientAnchor, TRichString, TCheckboxState, TCellAddress, String) |
GetRadioButtonState | Gets if a radio button in the active sheet is selected or not. Note that this only works for radio buttons added through the Forms toolbar. It won't return the values of ActiveX radio buttons. |
SetRadioButtonState | Sets the value of a radio button in the active sheet. Note that this only works for radio buttons added through the Forms toolbar. It won't return the values of ActiveX radio buttons |
AddRadioButton | Overloaded AddRadioButton(TClientAnchor, TRichString) AddRadioButton(TClientAnchor, TRichString, String) |
AddGroupBox | Overloaded AddGroupBox(TClientAnchor, TRichString) AddGroupBox(TClientAnchor, TRichString, String) |
GetObjectSelection | Gets the selected item in an object from the "Forms" palette. It can be a combobox or a listbox. 0 means no selection, 1 the first item in the list. Note that this only works for objects added through the Forms toolbar. It won't return the values of ActiveX objects. |
SetObjectSelection | Sets the selected item of an object from the "Forms" palette. It can be a combobox, a listbox, a spinbox or a scrollbar. Note that this only works for objects added through the Forms toolbar. It won't return the values of ActiveX objects. |
GetObjectSpinProperties | Returns maximum, minimum and increment in any control that has a spin or dropdown, like a listbox, combobox, spinner or scrollbar. |
SetObjectSpinProperties | Sets the spin properties of an object. You should apply this only to scrollbars and spinners. |
GetObjectSpinValue | Returns the current selected value of a scrollbar. |
SetObjectSpinValue | Sets the position in a scrollbar object. If the object is linked to a cell, the cell will be updated. |
AddComboBox | Adds a ComboBox to the active sheet. |
AddListBox | Adds a ListBox to the active sheet. |
AddButton | Adds a button to the sheet, with the associated macro. |
AddLabel | Adds a Label to the active sheet. |
AddSpinner | Adds a Spinner to the active sheet. |
AddScrollBar | Adds a ScrollBar to the active sheet. |
RenderObject | Overloaded RenderObject(Int32) RenderObject(Int32, String) RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TPointF, TUIRectangle, TUISize) RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TUIColor, TPointF, TUIRectangle, TUISize) RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TUIColor, Double, TPointF, TUIRectangle, TUISize) |
RenderCells | Overloaded RenderCells(Int32, Int32, Int32, Int32, Boolean) RenderCells(Int32, Int32, Int32, Int32, Boolean, Double, TUISmoothingMode, TUIInterpolationMode, Boolean) RenderCells(Int32, Int32, Int32, Int32, Boolean, Double, TUISmoothingMode, TUIInterpolationMode, Boolean, Double) RenderCells(Int32, Int32, Int32, Int32, Boolean, Double, TUISmoothingMode, TUIInterpolationMode, Boolean, Double, Boolean, Boolean) |
CellRangeDimensions | Returns the height and width that would be used by a range of cells (in Points, or 1/72 inches). |
RenderObjectAsSVG | Overloaded RenderObjectAsSVG(Int32, String, String, Encoding) RenderObjectAsSVG(Stream, Int32, String, String, Encoding) RenderObjectAsSVG(Int32, String, String, String, Encoding) RenderObjectAsSVG(Stream, Int32, String, String, String, Encoding) RenderObjectAsSVG(Int32, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle) RenderObjectAsSVG(Stream, Int32, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle) RenderObjectAsSVG(Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle) RenderObjectAsSVG(Stream, Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle) RenderObjectAsSVG(Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle) RenderObjectAsSVG(Stream, Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle) |
SendToBack | Sends the graphical object to the bottom layer on the display (z-order) position. It will show below and will be covered by all other objects on the sheet. |
BringToFront | Sends the graphical object to the top layer on the display (z-order) position. It will show above and will cover all other objects on the sheet. |
SendForward | Sends the graphical object one layer up on the display (z-order) position. It will show above and will cover the image at objectIndex+1. |
SendBack | Sends the graphical object one layer down. It will show below and will be covered by image at objectIndex-1. |
CommentRowCount | Maximum row index including comments. |
CommentCountRow | Number of comments on a given row. |
GetCommentRow | Returns the comment at position commentIndex on the specified row. |
GetCommentRowCol | Returns the column for comment at position commentIndex |
GetComment | Returns the comment at the specified row and column, or an empty string if there is no comment on that cell. |
SetCommentRow | Overloaded SetCommentRow(Int32, Int32, TRichString, TImageProperties) SetCommentRow(Int32, Int32, String, TImageProperties) |
SetComment | Overloaded SetComment(Int32, Int32, String) SetComment(Int32, Int32, TRichString) SetComment(Int32, Int32, TRichString, String, TImageProperties) SetComment(Int32, Int32, String, String, TImageProperties) |
GetCommentPropertiesRow | Returns the comment properties for the popup at position commentIndex |
GetCommentProperties | Gets the popup placement for an existing comment. If there is not a comment on cell (row,col), this will return null. |
SetCommentPropertiesRow | Sets the comment properties at the specified index. |
SetCommentProperties | Sets the popup placement for an existing comment. If there is not a comment on cell (row,col), this will create an empty one. |
LightClone | Returns a copy of this ExcelFile object with the same backing data, so the cells in both objects are the same. Using a light clone allows you to read from a single ExcelFile in two different threads, since while the data is the same (so you don't use twice the memory as a real clone would), you can have separate activesheets in both. So one thread can be reading from the "original" file with ActiveSheet = 1, and the other thread could be reading from the light clone with activeSheet = 3. |
InsertAndCopyRange | Overloaded InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode) InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode, TRangeCopyMode) InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode, TRangeCopyMode, ExcelFile, Int32) InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode, TRangeCopyMode, ExcelFile, Int32, TExcelObjectList) |
DeleteRange | Overloaded DeleteRange(TXlsCellRange, TFlxInsertMode) DeleteRange(Int32, Int32, TXlsCellRange, TFlxInsertMode) DeleteRange(Int32, Int32, TXlsCellRange, TFlxInsertMode, Boolean) |
MoveRange | Overloaded MoveRange(TXlsCellRange, Int32, Int32, TFlxInsertMode) MoveRange(TXlsCellRange, Int32, Int32, TFlxInsertMode, Boolean) |
ClearDataValidation | Overloaded ClearDataValidation ClearDataValidation(TXlsCellRange) |
AddDataValidation | Adds a new Data Validation to a specified range. |
GetDataValidation | Overloaded GetDataValidation(Int32, Int32) GetDataValidation(Int32, Int32, TXlsCellRange) |
GetDataValidationInfo | Returns the data validation information for an entry of the index. There are 2 ways you can access the data validation information on a sheet:...[more] |
GetDataValidationRanges | Returns a list of ranges for which a data validation definition applies. There are 2 ways you can access the data validation information on a sheet:...[more] |
CheckDataValidation | Overloaded CheckDataValidation(Int32, Int32) CheckDataValidation(Int32, Int32, Object, Boolean) |
CheckDataValidationsInSheet | Checks if all the cells in the active sheet inside data validations have values that are valid according to the data validation specifications. |
CheckDataValidationsInWorkbook | Checks if all the cells in the file inside data validations have values that are valid according to the data validation specifications. |
GetHyperLink | Returns the hyperlink at position index on the list. |
SetHyperLink | Modifies an existing Hyperlink. Use AddHyperLink to add a new one. |
GetHyperLinkCellRange | Returns the cell range a hyperlink refers to. |
SetHyperLinkCellRange | Changes the cells an hyperlink is linked to. |
AddHyperLink | Adds a new hyperlink to the Active sheet. Use SetHyperLink to modify an existing one. |
DeleteHyperLink | Deletes an existing hyperlink. |
LoopHyperLinks | Loops over the list of existing hyperlinks in the active sheet which are at least partially contained in range, and executes action for each one of those links. This can be faster than looping over all hyperlinks in a page if you have thousands, since this method uses spatial indexing. |
GetRowOutlineLevel | Returns the Outline level for a row. |
SetRowOutlineLevel | Overloaded SetRowOutlineLevel(Int32, Int32) SetRowOutlineLevel(Int32, Int32, Int32) |
GetColOutlineLevel | Returns the Outline level for a column. |
SetColOutlineLevel | Overloaded SetColOutlineLevel(Int32, Int32) SetColOutlineLevel(Int32, Int32, Int32) |
CollapseOutlineRows | Overloaded CollapseOutlineRows(Int32, TCollapseChildrenMode) CollapseOutlineRows(Int32, TCollapseChildrenMode, Int32, Int32) |
CollapseOutlineCols | Overloaded CollapseOutlineCols(Int32, TCollapseChildrenMode) CollapseOutlineCols(Int32, TCollapseChildrenMode, Int32, Int32) |
IsOutlineNodeRow | Returns true when the row is the one that is used for collapsing an outline. (it has a "+" at the left). |
IsOutlineNodeCol | Returns true when the column is the one that is used for collapsing an outline. (it has a "+" at the top). |
IsOutlineNodeCollapsedRow | Returns true when the row is an outline node (it has a "+" at the left) and it is closed (all children are hidden). |
IsOutlineNodeCollapsedCol | Returns true when the column is an outline node (it has a "+" at the top) and it is closed (all children are hidden). |
CollapseOutlineNodeRow | Use this method to collapse a node of the outline. If the row is not a node (IsOutlineNodeRow is false) this method does nothing. While this method allows a better control of the rows expanded and collapsed, you will normally use CollapseOutlineRows(Int32, TCollapseChildrenMode) to collapse or expand all rows in a sheet. |
CollapseOutlineNodeCol | Use this method to collapse a node of the outline. If the column is not a node (IsOutlineNodeCol is false) this method does nothing. While this method allows a better control of the columns expanded and collapsed, you will normally use CollapseOutlineCols(Int32, TCollapseChildrenMode) to collapse or expand all columns in a sheet. |
SubtotalDefaultEnglishString | Returns the english string that Excel uses to refer to Sums, averages, et. when you use the Subtotal command. You can use the result of this method together with Subtotal to specify the text for totals. |
Subtotal | This method works like the "Subtotal" command in Excel in the "Data" tab of the ribbon. It will take a number of cells and group them by similar values, adding a subtotal formula every new different value and a grand total at the end. It will also add outlines at the right. |
SelectCell | Selects a single cell. To select multiple cells, use SelectCells |
SelectCells | Selects a group of cells on a given pane. If you just want to select just one cell, you can use the simpler method SelectCell This property can work in different windows depending on the value of ActiveWindow |
GetSelectedCells | Returns the selected ranges on a sheet. This property can work in different windows depending on the value of ActiveWindow |
ScrollWindow | Overloaded ScrollWindow(Int32, Int32) ScrollWindow(TPanePosition, Int32, Int32) |
GetWindowScroll | Overloaded GetWindowScroll GetWindowScroll(TPanePosition) |
FreezePanes | This command is equivalent to Menu->Window->Freeze Panes. It will freeze the rows and columns above and to the left from cell. Note that because Excel works this way, when you SplitWindow the panes are suppressed and vice-versa See also GetFrozenPanes This property can work in different windows depending on the value of ActiveWindow |
GetFrozenPanes | Returns the cell that is freezing the window, "A1" if no panes are frozen. See also FreezePanes This property can work in different windows depending on the value of ActiveWindow |
SplitWindow | This command is equivalent to Menu->Window->Split. It will split the window in 4 regions. Note that because Excel works this way, when you FreezePanes the windows are unsplitted and vice-versa See also GetSplitWindow This property can work in different windows depending on the value of ActiveWindow |
GetSplitWindow | Returns the horizontal and vertical offsets for the split windows. Zero means no split. See also SplitWindow This property can work in different windows depending on the value of ActiveWindow |
GetDataConnections | Returns the data connections in the file. Use SetDataConnections to change the connections in the file. |
SetDataConnections | Sets the data connections in the file. |
GetChart | Returns a chart from an object position and path. If the object does not contain a chart, it returns null. Note that charts can be first-level objects (in chart sheets), or they can be embedded inside other objects, that can be themselves embedded inside other objects. So you need to recursively look inside all objects to see if there are charts anywhere. Look at the example in this topic to see how to get all charts in a sheet. |
AddChart | This method will add a chart to the active sheet. You can then add series and customize the returned ExcelChart object. Important: This method only works in xlsx files. |
Find | Finds a value inside a cell and returns the position for the cell, or null if nothing was found. |
Replace | Overloaded Replace(Object, Object, TXlsCellRange, Boolean, Boolean, Boolean) Replace(Object, Object, TXlsCellRange, Boolean, Boolean, Boolean, Action<TReplaceAction>) |
Sort | Overloaded Sort(TXlsCellRange, Boolean, Int32[], TSortOrder[], IComparer) Sort(TXlsCellRange, Boolean, Int32[], TSortOrder[], IComparer, TSortFormulaMode) |
SetAutoFilter | Overloaded SetAutoFilter(TXlsCellRange) SetAutoFilter(TXlsCellRange, Boolean) SetAutoFilter(Int32, Int32, Int32) SetAutoFilter(Int32, Int32, Int32, Int32) |
RemoveAutoFilter | Removes the AutoFilter from the active sheet. If there is no AutoFilter in the sheet, this method does nothing. |
HasAutoFilter | Overloaded HasAutoFilter HasAutoFilter(Int32, Int32) |
GetAutoFilterRange | Returns the range of cells with AutoFilter in the Active sheet, or null if there is not AutoFilter. |
Recalc | Overloaded Recalc Recalc(Boolean) |
RecalcCell | This method will recalculate a single cell and all of it's dependencies, but not the whole workbook. USE THIS METHOD WITH CARE! You will normally want to simply call Recalc or just save the file and let FlexCel calculate the workbook for you. This method is for rare situations where you are making thousands of recalculations and the speed of Recalc is not enough, and you have a big part of the spreadsheet that you know that didn't change. Note: If you are recalculating many cells without changing data, you can speed up calculations by calling...[more] |
StartBatchRecalcCells | This method tells FlexCel that you are going to call multiple times RecalcCell without changing any data in the spreadsheet. This way, FlexCel won't keep recalculating the same supporting cells each time you call RecalcCells. Always match this call with a call to EndBatchRecalcCells. |
EndBatchRecalcCells | This method ends the batch started by StartBatchRecalcCells and goes back to normal mode. |
RecalcExpression | Overloaded RecalcExpression(String) RecalcExpression(String, Boolean) |
RecalcRange | This method recalculates a formula that returns a range, and returns the cells that compose it. Note that normally ranges are a single rectangle (like in "=A1:B2"), and in this case this method will return a single element in the array. But you might have a formula like "=A1:A10, C6:C7" which will return two different ranges. In this case, the returned array will have more than one TCellAddressRange. If the formula doesn't resolve to a range or group of ranges, this method will return null. |
OffsetRelativeFormula | Use this method to know the actual formula that applies to a cell when the formula is relative. In some places, mostly data validations and names, Excel returns relative formulas. So for example you might have a name with a definition of "=Sheet1!A2" when you are positioned at cell A1. If you now move the cursor to cell A2 in Excel, the name definition will be "=Sheet1!A3" since the reference is relative to the cell where the cursor is. If you retrieve the name formula with FlexCel, as FlexCel doesn't have a cursor, it will always return the canonical formula as if you were positioned at A1. If you want to know the real formula when you are positioned at A2, you need to call this method with cellRow =3, cellCol = 1 and expression = "=Sheet1!A2". It will return "=Sheet1!A3". |
RecalcRelativeFormula | Use this method to know the value of a formula that applies to a cell when the formula is relative. In some places, mostly data validations and names, Excel returns relative formulas. So for example you might have a name with a definition of "=Sheet1!A2" when you are positioned at cell A1. If you now move the cursor to cell A2 in Excel, the name definition will be "=Sheet1!A3" since the reference is relative to the cell where the cursor is. If you use RecalcExpression(String)...[more] |
RecalcAndVerify | Use this method to validate a file. FlexCel does not support all the range of functions from Excel when recalculating, so unknown functions will return "#NAME?" errors. Using this function you can validate your user worksheets and see if all the formulas they use are supported. |
GetWhatIfTableList | Returns a list of the upper cells of the What-if tables in the page. You can then use GetWhatIfTable to get the definition of each one. |
GetWhatIfTable | Returns the range of cells that make the what-if table that starts at aRow and aCol. If there is no What-if table at aRow, aCol, this method returns null. If both the returned rowInputCell and colInputCell are null, this means this table points to deleted references. |
SetWhatIfTable | Creates an Excel What-if table in the range of cells specified by Range. Calling this method is the same as setting a cell value with a TFormula where TFormula.Span has more than one cell, and TFormula.Text is something like "{=TABLE(,A4)}". The parameters for the =TABLE function are rowInputCell and colInputCell, and they look the same a Excel will show them. |
GetLink | Gets the external link at position i. |
SetLink | Changes the external link at position i for a new value. Note that you can't add new links with this method, external links are added automatically when you add formulas that reference other worksheets. This method is only to change existing links to point to other place. All formulas pointing to the old link will point to the new. Note that the replacing filename should have the same sheets as the original, or the formulas might break. |
ConvertFormulasToValues | Overloaded ConvertFormulasToValues(Boolean) ConvertFormulasToValues(Boolean, Boolean) |
ConvertExternalNamesToRefErrors | Overloaded ConvertExternalNamesToRefErrors ConvertExternalNamesToRefErrors(Boolean) |
GetCachedFont0 | This method is used by FlexCel itself, you shouldn't call it directly. |
SetCachedFont0 | This method is used by FlexCel itself, you shouldn't call it directly. |
AddUserDefinedFunction | Adds a custom formula function to the FlexCel recalculation engine. Note that this formulas are only valid for Excel custom formulas, not for internal ones. For example, you could define "EDATE" since it is a custom formula defined in the Analysis Addin, but you cannot redefine "SUM". Note that if a custom formula with the name already exists, it will be replaced. Names are Case insensitive ("Date" is the same as "DATE"). Also note that some user defined functions come already built in FlexCel, so you might not need to define them. For more information on adding Custom Formulas make sure you read...[more] |
EvaluateUserDefinedFunction | Evaluates a custom function you have added earlier with AddUserDefinedFunction. You will not normally need to call this method, but it could be used for testing. If the function has not been added with AddUserDefinedFunction, this method will return TFlxFormulaErrorValue.ErrName. |
ClearUserDefinedFunctions | Removes all the custom formula functions from the FlexCel recalculation engine. |
RemoveUserDefinedFunction | Removes a single function from the FlexCel recalculation engine. If the function doesn't exist, this method will return false. |
IsDefinedFunction | Overloaded IsDefinedFunction(String) IsDefinedFunction(String, TUserDefinedFunctionLocation) |
GetFormulaTokens | Overloaded GetFormulaTokens(Int32, Int32) GetFormulaTokens(Int32, Int32, Int32) |
GetTokens | Returns the tokens for a formula in text form. See GetFormulaTokens(Int32, Int32) for more information. |
SetFormulaTokens | Overloaded SetFormulaTokens(Int32, Int32, TTokenList) SetFormulaTokens(Int32, Int32, Int32, TTokenList) |
SetTokens | This method converts a list of tokens in the corresponding string. Normally you get the tokens from GetTokens or GetFormulaTokens(Int32, Int32) |
RemoveMacros | If the file has macros, this method will remove them. |
HasMacros | Returns true if the file has any macros. |
UnshareWorkbook | Removes the "track changes" information of the workbook and unshares the workbook. This is only needed for xls files, as FlexCel doesn't save tracking changes in xlsx files, and the feature is deprecated in Excel. |
IsSharedWorkbook | Returns true is this is a shared workbook. This method only will return true for xls files, since FlexCel doesn't load tracking changes in xlsx files. |
HasWebAddinTaskPanes | Returns true if the file has any task pane web add-in. Note that this only applies to task pane addins. The content addins are just objects in the sheet. |
RemoveWebAddinTaskPanes | Removes all task pane web add-ins from the file. Note that this will only remove the task pane addins. You can remove the content addins by removing the corresponding objects in the sheet with DeleteObject(Int32) |
GetCustomTableStyle | Overloaded GetCustomTableStyle(String) GetCustomTableStyle(Int32) |
HasCustomTableStyle | Returns true if the workbook has a custom table style with name "name". |
SetCustomTableStyle | Adds a new or replaces an existing table style. |
RenameCustomTableStyle | Renames an existing custom table style. Note that this method won't change the table styles from existing tables from oldName to newName. So after renaming a table style, you should loop in all the tables in the workbook which use that table style, and manually rename their custom table styles too. |
DeleteCustomTableStyle | Overloaded DeleteCustomTableStyle(Int32) DeleteCustomTableStyle(String) |
DeleteAllCustomTableStylesInWorkbook | Deletes all custom table styles in the workbook. |
GetTable | Overloaded GetTable(String) GetTable(Int32) GetTable(String, Boolean) |
GetTableSheet | Returns the sheet number of the table, or raises an exception if the table doesn't exist. |
HasTable | Returns true if the table exists in the file. |
GetTableName | If there is a table in the cell at (row, col) then this method will return the name of the table. If not it will return an empty string. |
GetTableAtCell | If there is a table in the cell at (row, col) then this method will return the table definition. If not it will return null. |
AddTable | Adds a table to the active sheet. |
SetTable | Changes an existing table. The table to change is given by the table name in aTable. Note that this method won't change the name of the table. To do so, you need to call RenameTable |
RenameTable | Renames an existing table to a new name, renaming also all references to that table. Note that the final name of the table might not be the name you specified in newName, if newName already existed. You need to check the result of this method to know the actual name which the table was renamed to. |
DeleteTable | Deletes a table from the workbook, based on its name. Note that the table might not be in the active sheet. Note also that this will only delete the table itself, but not the data inside. |
DeleteAllTablesInSheet | Removes all the tables in the active sheet. The contents are not removed, only the table itself. |
PivotTableCountInSheet | Returns the number of pivot tables in the active sheet. |
AddCustomXmlPart | Adds a custom XML part to the file, as described in https://msdn.microsoft.com/en-us/library/bb608618.aspx |
RemoveCustomXmlPart | Deletes the part at the given position. ( 1 based) |
GetCustomXmlPart | Returns the part at the given position. (1 based) |
SetXmlMap | Sets the XML Maps in the file. This is equivalent to going to the "Developer" tab in Excel and then clicking in Source in the XML section. Set it to null to remove the XML Maps in the file. |
GetXmlMap | Returns the XML Maps in the file if it has any, or null if there are no XML Maps. Note that the map returned is a copy, so modifying it won't modify the map in the file. To modify the map in the file you need to get it with GetXmlMap, modify it, then set it with SetXmlMap |
GetEnumerator | Returns an enumerator that allows you to loop on all cells in the active worksheet. Once you start the foreach loop, you might change the active sheet and it won't change inside the enumerator. |
Properties
Name | Description |
---|---|
ActiveWindow | Gets or sets the active windows to which some sheet and workbook options like zoom will apply. (1 based) Note that spreadsheets normally have a single Window, so this value will most likely be 1 and should stay that way. If you are working with multiple spreadsheet windows, you can change this property to change the sheet options of a particular window. The properties that apply to a specific window and are affected by this property mention it on their docs. |
WindowCount | Returns the number of windows in the file. Note that this isn't the sheet count, but the number of views of the workbook. Most Excel documents have only one window. |
ActiveSheetForActiveWindow | Gets or sets the active sheet for the ActiveWindow. Note that this won't change the active sheet for FlexCel when you enter a value, you still need to call ActiveSheet for that. This property will only change the sheet that is active in that window when you open the file in Excel. Setting this property will also unselect the other sheets. If you want to select multiple sheets, make sure to select them *after* setting the ActiveSheetForActiveWindow. |
VirtualMode | Set this value to true to turn Virtual Mode on. Look at 'Virtual mode' in the Performance Guide for more information. |
DefaultFileFormat | Determines the default file format used by Excel when saving a file without specifying one, and when the file format can't be determined from the extension of the file. If set to Automatic (The default) the file will be saved in the same format it was opened. That is, if you opened an xlsx file it will be saved as xlsx. If you opened an xls file (or created it with XlsFile.NewFile()) it will be saved as xls. When this property is automatic, text files will be saved as xls. |
ExcelVersion | Defines the Excel mode used in this thread. Note that while on v2007 (the default) you still can make xls 97 spreadsheets, so the only reason to change this setting is if you have any compatibility issues (for example your formulas depend on a sheet having 65536 rows). IMPORTANT: Do NOT change this value after reading a workbook. Also, remember that the value is changed for all the reports in all threads. |
XlsBiffVersion | Xls files created by Excel 2007 have additional records that allow the generated file to store characteristics not available in Excel 2003 or older. (Like for example True color for cells instead of 54 colors). When opening an xls file created by Excel 2007 in Excel 2007, Excel will be able to read those values back. By default FlexCel will read those extra records and when reading, and identify the file it creates as created by Excel 2007 when writing, so when you open it in Excel 2007 it will read those additional records. If for any reason you prefer FlexCel to behave as Excel 2003, saving the files as if they were created by Excel 2003 (So Excel 2007 will ignore the additional characteristics), and also stop FlexCel from reading those extra records, just change the value of this property. |
ExcelFileFormat | Empty files created by different versions of Excel can have different characteristics. For example, the default font in an Excel 2003 file is Arial, while the default in 2007 is Calibri, and in 2023 it is Aptos. This property returns the version of file that is loaded into FlexCel. When calling NewFile(Int32, TExcelFileFormat) or when opening a new file, FlexCel will update the value of this property. |
XlsxExtraCompatibility | By default, FlexCel creates xlsx files that conform to the published xlsx spec, but are not necessarily the same as a file Excel would create. FlexCel might use different prefixes, etc, as the ones Excel choose to use. While this is ok, some third party tools might have problems opening the xlsx files if they are not exactly as Excel would create them. If you are having issues with third party tools and the xlsx files created by FlexCel, you can try setting this property to true. Note: setting this property to true might result in files that contain invalid Ids, because the Ids are used by FlexCel and Excel. This is a very unlikely possibility, but the risk is there. If possible, it is best to keep this property false. |
XlsxCompatibilityConvertIndexedColorsToRGB | By default, if an xls or xlsx file has indexed colors or if you set an indexed color with the FlexCelAPI, FlexCel will save those colors as indexed in the final file. This is correct and the default, but LibreOffice/OpenOffice at the time of this writing (version 6.2) won't understand indexed colors in xlsx files. So if you have xlsx files with indexed colors that you want to display correctly in Libre/OpenOffice, you must turn this property on. |
StrictOpenXml | Read this file to know if the xlsx file loaded by FlexCel is a normal xlsx file or a "Strict Open XML file". Set this property to make FlexCel save as strict or normal open xlsx file. This property has no effect in xls files, only in xlsx. If you are not sure about what a strict open xml file is, just keep this property false and FlexCel will output normal xlsx files. IMPORTANT:FlexCel works by preserving a lot of stuff it doesn't know about, and that stuff might be valid in normal files and invalid in strict files or vice-versa. So if you open an strict file and save it as normal, or open a normal file and save it as strict, it might happen that FlexCel preserves some records or namespaces that are not allowed in the new format. Given this, you shouldn't use this property to change the type of existing files, except for simple files or files that you created yourself with...[more] |
KeepMaxRowsAndColumnsWhenUpdating | Defines what FlexCel will do when it finds a reference to the last row or column in an Excel 97-2003 spreadsheet, and it is upgrading to Excel 2007. If false (the default) row 65536 will be updated to row 1048576, and column 256 to column 16384. If true, references will stay the same. Note: This is a static global property, so it affects all threads running. |
ActiveFileName | The file we are working on. When we save the file with another name, it changes. When we open a stream, it is set to "". This value is also used to get the text of Headers and Footers (when using the filename macro). When using the filename macro on headers/footers, make sure you set this value to what you want. |
AllowOverwritingFiles | Determines if a call to "Save()" will automatically overwrite an existing file or not. |
IsXltTemplate | Determines if the file is a template (xlt format instead of xls, xltx instead of xlsx, or xltm instead of xlsm). Both file formats are nearly identical, but there is an extra record needed so the file is a proper xlt template. Note that when saving to a file, FlexCel can detect if this is a template from the extension, and so if you save to *.xlt, *.xltx or *.xltm the file will be saved as template, even if this property is false. When saving to a stream, you need to set this property correctly because FlexCel can't guess it from the filename. |
ActiveSheet | The Sheet where we are working on, 1-based(First sheet is 1, not 0). Always set this property before working on a file. You can read or write this value. |
ActiveSheetByName | The sheet where we are working on, referred by name instead of by index. To change the active sheet name, use SheetName |
SheetCount | The number of sheets on the file. |
SheetCountVisible | Number of visible sheets in the file. |
SheetName | Reads and changes the name of the active sheet. To switch to another sheet by its name, use ActiveSheetByName |
SheetCodeName | Returns or sets the codename of a sheet, that is an unique identifier assigned to the sheet when it is created. Codenames are useful because they never change once the file is created, and they are what macros reference. Very important! We don't support changing codenames if the file has macros, because we can't modify the required macros to use the modified codename. Also, Excel 2003 or older will ignore the codename if the file doesn't have macros. Excel 2007 or newer will preserve the codenames even if the file doesn't have macros....[more] |
SheetID | Returns an unique identifier for the active sheet. This is a value that is only used by FlexCel, and you can use it together with GetSheetIndexFromID to retrieve a sheet after deleting or adding sheets. While normally you can use ActiveSheet to store and retrieve a sheet, if you plan to delete or add sheets before restoring the active sheet, the stored ActiveSheet could become invalid. Note that this is a value internal for FlexCel, and not stored in the xls/x file....[more] |
SheetVisible | Sets the visibility of the active sheet. |
SheetZoom | Reads/Writes the zoom of the current sheet. Note that this property refers to the zoom in the current page view mode. If you are for example in Page Break Preview mode, this would be the zoom for Page Break Preview. You can change of page view mode and the zoom for all of the modes with SheetView This property can work in different windows depending on the value of ActiveWindow |
FirstSheetVisible | This is the first sheet that will be visible in the bar of sheet tabs at the bottom. Normally you will want this to be 1. Note that every time you change ActiveSheet this value gets reset, because it makes no sense to preserve it. If you want to change it, change it before saving. The same way, to read it, read it just after opening the file. Please also note that if the first sheet you select is hidden, FlexCel will ignore this value and select a visible sheet. (otherwise Excel would crash) This property can work in different windows depending on the value of...[more] |
SheetTabColor | Reads/Writes the color of the current sheet tab. TExcelColor.Automatic to specify no color. |
SheetView | Returns and sets the page view mode with their corresponding zooms. Note that changing the zoom here changes SheetZoom This property can work in different windows depending on the value of ActiveWindow |
SheetIsRightToLeft | If true then the sheet goes from right to left, with A1 starting at the top right of the page. You can also set this option with SheetOptions |
ShowGridLines | True if the gray grid lines are shown on the Active sheet. You can also set this option with SheetOptions This property can work in different windows depending on the value of ActiveWindow |
ShowGridHeadings | True is the column headings ("A", "B", etc) and row headings ("1", "2", etc) are shown. You can also set this option with SheetOptions by changing TSheetOptions.ShowRowAndColumnHeaders This property can work in different windows depending on the value of ActiveWindow |
ShowFormulaText | When true, the formula text will be displayed instead of the formula value. You can also set this option with SheetOptions This property can work in different windows depending on the value of ActiveWindow |
GridLinesColor | Color of the grid separator lines. This property can work in different windows depending on the value of ActiveWindow |
HideZeroValues | When true number 0 will be shown as empty. You can also set this option with SheetOptions This property can work in different windows depending on the value of ActiveWindow |
SheetType | Use this property to know it the ActiveSheet is a worksheet, a chart sheet or other. |
SheetOptions | This property groups a lot of properties of the sheet, like for example if it is showing formula texts or the results. Most of this properties can be changed directly from XlsFile, but this method allows you to change them all together, or to easily copy the options from one file to another. Look also at SheetWindowOptions for options that affect all sheets. This property can work in different windows depending on the value of ActiveWindow |
SheetWindowOptions | This property groups a lot of properties of all the sheets in the workbook, like for example if the sheet tab bar at the bottom is visible. Look also at SheetOptions for options that affect only the active sheet. This property can work in different windows depending on the value of ActiveWindow |
HPageBreakCount | The number of horizontal page breaks in the active sheet. |
VPageBreakCount | The number of vertical page breaks in the active sheet. |
AllowEnteringEmptyStrings | By default, FlexCel won't allow you to enter empty or null strings into a cell; it will create a blank record instead. If for any reason you need to enter actual empty strings (which might be confusing to the Excel user) set this property to true. |
AllowEnteringUnknownFunctionsAndNames | Whenever you try to use an unknown function in a formula, like "=MYFUNCTION()", FlexCel will raise an Exception. Same happens with unknown names. This is normally the expected behavior, so you don't enter a misspelled name by mistake, and you can add used defined function to FlexCel so it understands it. But in some cases, you might want to allow any function to be entered, no matter if is known or not: Excel behaves this way. For those cases, set this property to true. The unknown functions will return #NAME? as formula result. |
FormatCount | Number of custom formats defined in all the file. When calling GetFormat(XF), 0<=XF<FormatCount. |
GetDefaultFormat | Returns Excel standard format for an empty cell. (NORMAL format) |
GetDefaultFormatNormalStyle | Returns Excel standard format for the normal style. "Normal" style applies to the headers "A", "B" ... at the top of the columns and "1", "2"... at the left of the rows. This method is the same as calling xls.GetStyle(xls.GetBuiltInStyleName(TBuiltInStyle.Normal, 0)) You normally will want to use GetDefaultFormat instead of this method. |
DefaultFormatId | Returns XF identifier for the style that applies to all empty cells. Note that this is different from the "Normal" style as defined inside Excel. This is a "Cell" format that can be applied to cells, while "Normal" is a "Style" format that is applied to this cell format. |
FontCount | Number of fonts defined in all the sheet. When calling GetFont(fontIndex), 0<=fontIndex<FormatCount. |
GetDefaultFont | Returns Excel standard font for an empty cell. |
GetDefaultFontNormalStyle | Returns Excel font for the "normal" style. This style is used to draw the row and column headings. |
ConditionalFormatCount | Returns the number of conditional format blocks on the list. You can use this value to loop on them and retrieve the individual ones with GetConditionalFormat |
StyleCount | Returns the number of named styles in the file. |
CellMergedListCount | For using with CellMergedList on a loop: for (int i=1;i <= CellMergedListCount;i++) DoSomething(CellMergedList(i))... |
RowCount | Number of rows actually used on the sheet. |
ColCount | Number of columns actually used on the active sheet, including formatted columns. You will normally want to use ColCountOnlyData instead. Note that this method is slow as it needs to loop over all the rows to find out the biggest used column. Never use it in a loop like "for (int col = 1; col <= xls.ColCount; col++)". Instead try to use ColCountInRow(Int32). If you *need* to use ColCount, cache its value first:...[more] |
ColFormatCount | Returns the number of formatted columns in the file. Note that in xlsx files this number can be very big. |
ColCountOnlyData | While ColCount will return the maximum column including both data and formatted columns, this method doesn't include formatted columns, only cells with data, and it is normally what you need to use. Important: This method includes blank formatted cells. See The Maximum Used Column On A Sheet |
DefaultRowHeight | The default height for empty rows, in Excel internal units. (1/20th of a point). IMPORTANT: For this property to have any effect, you also need to set DefaultRowHeightAutomatic = false. To get the real default row height Excel will use when DefaultRowHeightAutomatic = true or DefaultRowHidden = true use DefaultRowHeightVisual See Excel Internal Units...[more] |
DefaultRowHeightAutomatic | When this property is true, the row height for empty rows is calculated with the height of the "Normal" font and will change if you change the Normal style. When false, the value in DefaultRowHeight will be used. |
DefaultRowHidden | When this property is true, rows with no data are hidden by default. Note that this property only affects the visibility of empty rows. If for example row 6 is empty and you have this property true, then row 6 will be hidden. But if you write any value in a cell in row 6, then the row won't be empty anymore, and it won't be hidden anymore either. |
DefaultColWidth | The default width for empty columns, in Excel internal units. (Character width of font 0 / 256) See Excel Internal Units for more information in Excel internal units. |
ColorPaletteCount | The number of entries on an Excel color palette. This is always 56. |
GetUsedPaletteColors | Returns a list of the used colors on the palette. You can use it as an entry to NearestColorIndex(TUIColor) to modify the palette. |
NamedRangeCount | The count of all named ranges on the file. |
PageHeader | Page header on the active sheet. Note that this property sets the same header for the all the pages. In Excel 2007 or newer you can set a different header for the first page, or odd/even pages. If you want to control these options, see GetPageHeaderAndFooter and SetPageHeaderAndFooter. A page header is a string that contains the text for the 3 parts of the header. The Left section begins with &L, the Center section with &C and the Right with &R...[more] |
PageFooter | Page footer on the active sheet. For a description on the format of the string, see PageHeader |
PrintGridLines | True if the gray grid lines are printed when printing the spreadsheet. |
PrintHeadings | When true the row and column labels (A,B...etc for columns, 1,2... for rows) will be printed. |
PrintHCentered | When true the sheet will print horizontally centered on the page. |
PrintVCentered | When true the sheet will print vertically centered on the page. |
PrintToFit | If true, sheet will be configured to fit on PrintNumberOfHorizontalPages x PrintNumberOfVerticalPages. |
PrintCopies | Number of copies to print. |
PrintXResolution | Horizontal printer resolution on DPI. |
PrintYResolution | Vertical printer resolution on DPI. |
PrintOptions | All print options in a single place. You will normally want to set individual properties like PrintLandscape |
PrintOptionsInitializedFromPrinter | If this property is false, then Excel has not read the printer options from the printer, and PrintLandscape, PrintPaperSize, PrintScale, PrintXResolution, PrintYResolution and PrintCopies will be ignored. This property will change automatically to true if you manually change any of the above properties. |
PrintLandscape | If true, page will be printed landscape, else portrait. This property modifies PrintOptions |
PrintBlackAndWhite | If true, page will be printed in "Excel Black and White". Important: This property doesn't mean that the file will be printed in black and white. Instead it means the option in the Page Setup dialog: https://support.microsoft.com/en-us/office/page-setup-71c20d94-b13e-48fd-9800-cedd1fec6da3 Basically, when you select this option no background will be printed, and all foreground colors will be black. So if you have a cell with a black background and a white font, it will print as white background with a black font. ...[more] |
PrintOverThenDown | If true, the pages will be printed to the right, then down. Otherwise pages will be printed down, then to the right. This property modifies PrintOptions |
PrintDraftQuality | If true, the pages will be printed in draft quality. This property modifies PrintOptions |
PrintScale | Percent to grow/shrink the sheet when printing. 100 means a page scale of 100%. |
PrintFirstPageNumber | Page number that will be assigned to the first sheet when printing. (So it will show in page headers/footers). You might set this value to null to keep the page automatic. Also, the value returned here will be null it this value is not set (Set to Automatic) |
PrintNumberOfHorizontalPages | If set, the sheet will be printed on at most this number of horizontal pages. Use 0 to have unlimited horizontal pages while still limiting the vertical pages with PrintNumberOfVerticalPages. (see 'Preparing for printing' in the Api Developer Guide) |
PrintNumberOfVerticalPages | If set, the sheet will be printed on at most this number of vertical pages. Use 0 to have unlimited vertical pages while still limiting the horizontal pages with PrintNumberOfHorizontalPages. (see 'Preparing for printing' in the Api Developer Guide) |
PrintPaperSize | Pre-defined standard paper size. If you want to set up a printer specific paper size, see SetPrinterDriverSettings |
PrintPaperDimensions | Returns the dimensions for the selected paper. See also PrintPaperSize. |
PrintErrors | Determines how the errors will be printed. |
PrintComments | Determines how the comments will be printed. |
ImageCount | The number of images in the active sheet. |
ObjectCount | Count of all graphical objects on the sheet. They can be charts, images, shapes, etc. |
IsLightClone | Returns true if this object was created with a LightClone call. Light Cloned objects share the data with another file, and they don't switch the selected sheet in the Excel file when changing ActiveSheet |
DataValidationCount | Returns the number of DataValidation structures in the active sheet. There are 2 ways you can access the data validation information on a sheet:...[more] |
HyperLinkCount | The count of hyperlinks on the active sheet |
OutlineSummaryRowsBelowDetail | Determines whether the summary rows should be below or above details on outline. |
OutlineSummaryColsRightToDetail | Determines whether the summary columns should be right to or left to the details on outline. |
OutlineAutomaticStyles | This handles the setting of Automatic Styles inside the outline options. |
Protection | Protection data for the file. Modify its properties to open and read encrypted files. |
DocumentProperties | Document properties for the file. With this object you can read the properties (Author, Title, etc.) of a file. |
ChartCount | Returns the count of charts on this sheet. Please take note that this method will not return the number of embedded objects with charts inside in a sheet, but just the number of charts in the sheet. In simpler terms, this method will return 0 for all worksheets, and 1 for all chart sheets. This is not a very useful method, but it needs to be this way to be consistent with GetChart. So, looping like this:...[more] |
OptionsDates1904 | Excel has 2 different date systems. On windows systems it uses 1900 based dates, and on old Macintosh systems it uses 1904 dates. You can change this on Excel under Options, and this property allows you to know and change which format is being used. See https://support.microsoft.com/en-us/help/214330/differences-between-the-1900-and-the-1904-date-system-in-excel |
OptionsR1C1 | Use this property to change the reference system used in the file. Note that this option only changes how Excel and FlexCel will display the file. Internally, the formulas will always be stored in A1 format, and converted by Excel to and from R1C1 if this property is true. FlexCel will also use this property to render the file when it is set to print formulas. Also, this property doesn't change how FlexCel will parse or return the formula text in the cells or names. By default, even if this property is true, you will need to enter the formulas in FlexCel in A1 mode. To change the entry mode in FlexCel, please use...[more] |
OptionsSaveExternalLinkValues | This property has the value of the corresponding option on Excel options. |
OptionsPrecisionAsDisplayed | This property has the value of the corresponding option on Excel options. |
OptionsMultithreadRecalc | Number of threads that can be used at the same time by Excel when recalculating. Set it to 0 to disable multithread recalculation, and to -1 to let Excel decide the best number of threads to use. The maximum value for this property is 1024. This option only applies to Excel 2007 or newer. |
OptionsForceFullRecalc | If true, Excel will do full recalculations of the spreadsheet when you change a cell. If false, only the cells that depend on the cell being changed will be recalculated. This option only applies to Excel 2007 or newer. |
OptionsFullRecalcOnLoad | This property tells you if the open file wasn't recalculated when saved. If true, the workbook doesn't have recalculated values and will be recalculated when open in Excel. This option only applies to xlsx files. Note that if you open a file which has FullRecalcOnLoad = true in FlexCel, recalculate it and save it, FlexCel will save the file with FullRecalcOnLoad = false. To change what FlexCel writes in FullRecalcOnLoad when saving, change OptionsFullRecalcOnLoadMode...[more] |
OptionsFullRecalcOnLoadMode | Defines how FlexCel will identify the files it creates to be calculated by Excel when it opens them. |
OptionsRecalcCircularReferences | If true, Excel and FlexCel will do iterative calculating over cells with circular references, until OptionsRecalcMaxIterations is reached or the difference is less than OptionsRecalcMaxChange |
OptionsRecalcMaxIterations | Maximum number of iterations when calculating circular references (OptionsRecalcCircularReferences is true), |
OptionsRecalcMaxChange | Maximum difference between 2 iterations when calculating circular references (OptionsRecalcCircularReferences is true), |
OptionsAutoCompressPictures | If true, Excel will try to compress the pictures to keep sizes down. This option only applies to Excel 2007 or newer. |
OptionsCheckCompatibility | Whether the "Check for compatibility" dialog will pop up when saving as xls in Excel 2007 or newer. This option only applies to Excel 2007 or newer. Important: When this option is true, Excel will refuse to enable "Autosave" and upload the files to OneDrive (Autosave is the first option in the title bar in Excel 2019). If true, you will get a message: "How do I turn on Autosave? Before Autosave can save your file, you need to fix the following: This file was created in an older file format. Please select File > Save As to update the file format."...[more] |
OptionsForceUseCheckCompatibility | When the option OptionsCheckCompatibility is true, Excel will refuse to austosave the file. To avoid a confusing situation where Excel refuses to autosave the file and shows a vague warning about an "older file format", OptionsCheckCompatibility is ignored by FlexCel. In order to force FlexCel to save OptionsCheckCompatibility to the file (thus disabling the "Autosave" function) you need to set this property to true besides...[more] |
OptionsBackup | Defines whether to save a backup copy of the workbook or not. |
OptionsRecalcMode | Reads and writes the recalculating options in the file. Note that this only affects the file and how Excel will recalculate, not how FlexCel does its recalculation. FlexCel ignores this setting and uses RecalcMode instead. |
RecalcMode | Set this property to change how the file will be recalculated. Note that this affects only how FlexCel recalculates the file, but not how Excel will recalculate it. It doesn't change anything in the generated file. To change the options for the file, use OptionsRecalcMode instead. |
CellStackTraceMaxSize | Defines what is the maximum number of entries returned in the stack trace when calling RecalcAndVerify. In order to keep the stack trace not too big this number is limited, but if you need a bigger stack trace to see the full loop of cells you can increase this number. Note that if you want to calculate linked files, you need to set the property TWorkspace.CellStackTraceMaxSize instead and it will affect all workbooks. |
RecalcVersion | Defines which version of Excel recalculation engine will be saved in the file. This affects how Excel will recalculate the file on open. If you set this property for example to Excel2007, then any Excel version newer than Excel 2007 will recalculate all formulas when you load the file, so it will modify the workbook and will ask for saving changes when closing. Even if you just open and close the file. Note that this will only happen if there are formulas on the sheet. If there are any formulas that FlexCel can't recalculate, you should set this property to AlwaysRecalc. For example, if you have the formula:...[more] ...[more] |
NeedsRecalc | True if the file has been modified after loading. |
FileNeedsRecalc | If true, the file has been modified and not recalculated after load. |
Recalculating | Returns true if the workbook is being recalculated. |
LinkCount | Returns the number of external links for the file. You can access those links with GetLink and SetLink |
SemiAbsoluteReferences | When this property is false, inserting and copying ranges will behave the same as it does in Excel. When this property is true, absolute references to cells inside the block being copied will be treated as relative. For example, if you have:...[more] |
FormulaReferenceStyle | Specifies which reference style to use when entering formulas: A1 or R1C1. Note that this property is different from OptionsR1C1. OptionsR1C1 modifies a property of the file, that handles how references will show in Excel. This property modifies how FlexCel parses or returns the formulas, and has no effect at all in the file generated. Also note that R1C1 and A1 modes are completely equivalent, and formulas are always stored as A1 inside the generated files. This property only affects the parsing of the formulas, the file generated will be exactly the same no matter the value of this property. And Excel will show it in A1 or R1C1 mode depending only in...[more] |
ErrorActions | Determines if FlexCel will throw Exceptions or just ignore errors on specific situations. If you are trying to recover corrupt files, you might also want to check RecoveryMode |
RecoveryMode | When this property is set to true, FlexCel will try to open corrupt files ignoring most of what can be ignored. Note that FlexCel is not a recovery tool and that this property might be able or not to open a corrupt file. Also, even if you are able to open the file with FlexCel, when you save the corrupt file, it might stay corrupt. FlexCel saves back as much as it can from the original file in order to preserve them, and this means it might save the corrupt parts too. Note that when opening a file in recovery mode, the value of...[more] |
FileFormatWhenOpened | Returns the file format that the file had when it was opened. If the file was created with NewFile, the file format when opened is xls. |
WidthCorrection | Factor to multiply default column widths. See remarks for a detailed explanation. |
HeightCorrection | Factor to multiply default row heights. See remarks for a detailed explanation. |
Linespacing | A Linespacing of 1 means use the standard GDI+ linespace when a cell has more than one line. A linespace of 2 would mean double linespacing, and 0.5 would mean half linespacing. Normally linespacing in Excel is a little bigger than linespacing in GDI+, so you can use this property to fine tune what you need. This property doesn't alter the Excel file in any way. It is only used when rendering. |
CellMarginFactor | This property can be used to add a margin to the cells when rendering, so text is rendered smaller and can have more line breaks. The default value of 1.0 means normal cells. The bigger this value, the bigger the margins and the smaller the real cell width for rendering the text. You might want to make this value a little larger than 1 if autofitting and Excel is wrapping text that FlexCel fits into one line. |
CellIndentationRendering | Excel doesn't adapt the cell indentation when changing the print scale. This means that if a cell indentation is 0.1 inches at 100% print scale, it will also be 0.1 inches at 50% print scale. This will break the layout of your files when changing the print scaling, and so by default FlexCel won't behave like Excel here and make the indentation half the size if printing at half the scale. If you want to mimic the exact Excel behavior, set this property to true. See 'Cell indentation' in the Api Developer Guide...[more] |
HeadingColWidth | Width that will be used by the added column with row numbers when PrintHeadings is true. The default value (0) means to use an automatic value which is fine if you don't have too many rows to print. A positive value will make the column wider or narrower. A negative value will auto-calculate the width depending in the number of rows and normal font of the spreadsheet. |
HeadingRowHeight | Height that will be used by the added row with column headers when PrintHeadings is true. The default value (0) means to use an automatic value which is fine with normal fonts. A positive value will make the column wider or narrower.A negative value will auto-calculate the height depending in the normal font of the spreadsheet. |
DpiForImages | Allows you to change the dpi for vector images (metafiles) when they are rasterized for converting to PDF / HTML / etc. Note that this is a static setting and will affect all files. This setting is the same as FlexCelConfig.DpiForImages. |
XlsxCompressionLevel | Zip compression level when creating xlsx files. Xlsx files are zip files, and you can compress more or less by trading speed for file size. The faster you can create the file, the bigger the xlsx files created will be. Excel by default uses "Fastest" compression level and we use "Default". Normally using compression levels more than default is not worth it, since the files will take a lot longer to be created, and the size reduction will be very small. |
ScreenScaling | This property lets you specify the screen scaling that FlexCel will assume for reading xlsx files in percent. (default is 100 which means 100%). The values can be between 100 and 500. Column widths in xlsx files which don't have a fixed column width set will be different in different screen resolutions. So we need to know which resolution to emulate in order to read those files correctly. You will probably want to leave this property to the default value of 100, but you can change it if needed. ...[more] |
IgnoreFormulaText | This is an optimization property. If you set it to true, methods like GetCellValue or GetNamedRange won't return the formula text, just the formula results. If you don't care about formula texts, setting this property to true can speed up the processing of huge files. |
CustomTableStyleCount | Returns the number of custom tables styles defined in the workbook. |
TableCountInWorkbook | Returns the number of tables in the whole workbook. (Not just the active sheet) |
TableCountInSheet | Returns the number of tables in the active sheet. Use GetTable(Int32) to retrieve the tables in the sheet. |
CustomXmlPartCount | Returns the number of custom xml parts in the active document. |
Events
Name | Description |
---|---|
VirtualCellRead | If you assign this event FlexCel will not load the file into memory when opening a file, allowing you to open very big files using little memory. This event will be called for every value read from the file, and then the value will be discarded, instead of loaded into memory. Look at 'Virtual mode' in the Performance Guide for more information. |
VirtualCellStartReading | When in virtual mode (VirtualCellRead is assigned) this event will be called after the sheet names have been read, but before starting to read the cells. You can use this event to know how many sheets you are reading. |
VirtualCellEndReading | When in virtual mode (VirtualCellRead is assigned) this event will be called after the file has been processed. You can use it to do cleanup. |