XlsFile Class
This is the FlexCel Native Engine. Use this class to natively read or write an Excel 2 or newer file.
Remarks
Note that most arrays here are 1-based and not 0-based, to follow the convention used on Excel Automation. So, if you are using C# or C++, your loops should look like:
for (int i = 1; i <= SomeProperty.Count; i++)
and not
for (int i = 0; i < SomeProperty.Count; i++)
Syntax
Namespace: FlexCel.XlsAdapter
public class XlsFile: ExcelFile
Constructors
Name | Description |
---|---|
XlsFile | Overloaded XlsFile XlsFile(Boolean) XlsFile(String) XlsFile(String, Boolean) XlsFile(Int32, Boolean) XlsFile(Stream, Boolean) XlsFile(Int32, TExcelFileFormat, Boolean) |
Methods
Name | Description |
---|---|
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. |
GetBuiltInFormat | Returns one of the 49 built in formats Excel supports. For more information see SetBuiltInFormat |
SetBuiltInFormat | Excel has 49 predefined formats which aren't stored in the xls/x file, only the format id is stored. When opening the file in Excel, the cells formatted with those internal formats will be formatted according to the language and version of Excel, not all of them return the same. For example, some Excel versions will display format 38 as "#,##0 ;[Red](#,##0) " (negative numbers in parenthesis) while others will display the same format 38 as "#,##0 _$;[Red]-#,##0 _$" (negative numbers have "-" sign)....[more] |
NewFile | Creates a new empty file, with the specified number of sheets. |
NewFileStatic | This method creates a new file in without virtual calls, so it can be called from a constructor. |
Open | Overloaded 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[], String[]) Import(TextReader, Int32, Int32, Char, Char, ColumnImportType[], String[]) |
Save | Overloaded Save(String, TFileFormats, Char, Encoding) Save(Stream, TFileFormats, Char, Encoding) |
SaveForHashing | This method will save the file in a format that will remain the same if the file is not modified. Normal xls files contain TimeStamp fields that might be modified when the file is downloaded or just copied. While you will not be able to load the file saved, you might use this method to create a hash of a file and compare it to others to know if something changed. |
Export | Overloaded Export(TextWriter, TXlsCellRange, Char, Boolean, String) Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean, Boolean, String) |
GetSheetIndex | Finds a sheet name on the workbook and returns its index. Depending on the "throwException" parameter, this method will raise an exception or return -1 if the sheet does not exist. To change the active sheet by the name, use ExcelFile.ActiveSheetByName. See also ExcelFile.GetSheetName |
GetSheetName | Returns the sheet name for a given index. To change the active sheet by the name, use ExcelFile.ActiveSheetByName. See also ExcelFile.GetSheetIndex(String) |
GetSheetIndexFromID | Returns the ActiveSheet for a stored ExcelFile.SheetID. You can use this method together with ExcelFile.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. |
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, ExcelFile) InsertAndCopySheets(Int32, Int32, Int32, ExcelFile) |
ClearSheet | Clears all data on the active sheet, but does not delete it. |
DeleteSheet | Deletes sheet aSheet and aSheetCount-1 sheets more to the right. It will change all formula references to that sheet to invalid, and might change the active sheet so it remains valid. |
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 ExcelFile.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...[more] |
SetSheetSelected | This method will set a sheet tab as selected. Note that this is different from ExcelFile.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 ExcelFile.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...[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 | Inserts a Horizontal Page Break at the specified row. If there is one already, it will do nothing. If the number of pagebreaks is bigger than the maximum Excel can admit, it will add it anyway, but you might get an exception when saving the file as xls. Exporting as images or PDF will use those additional page breaks. To control what to do when there are too many page breaks, see ExcelFile.ErrorActions |
InsertVPageBreak | Inserts a Vertical Page Break at the specified column. If there is one already, it will do nothing. If the number of pagebreaks is bigger than the maximum Excel can admit, it will add it anyway, but you might get an exception when saving the file as xls. Exporting as images or PDF will use those additional page breaks. To control what to do when there are too many page breaks, see ExcelFile.ErrorActions |
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 ExcelFile.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 ExcelFile.AutoPageBreaks after calling this method. |
GetKeepRowsTogether | Returns the value of level for a row as set in ExcelFile.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 ExcelFile.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(Int32, Int32) AutoPageBreaks(Int32, TUIRectangle) |
GetCellValue | Overloaded GetCellValue(Int32, Int32, Int32) GetCellValue(Int32, Int32, Int32, Int32) |
GetCellValueIndexed | Reads a Cell Value and Format, using a column index for faster access. Normal GetCellValue(row, col) has to search for the column on a sorted list. If you are looping from 1 to ExcelFile.ColCountInRow(Int32) this method is faster. |
SetCellValue | Overloaded SetCellValue(Int32, Int32, Object, Int32) SetCellValue(Int32, Int32, Int32, Object, Int32) |
ConvertString | Converts a string into the best datatype (a boolean, a number, etc) |
SetCellFromString | Converts a string to the best datatype, and the enters it into a cell. |
GetStringFromCell | This method will return a rich string that is formatted similar to the way Excel shows it. For example, if you have "1.0" on a cell, and the cell is formatted as exponential, this method will return "1.0e+1" It might also change the color depending on the value and format. (for example, red for negative numbers) Conditional formats are not applied, you need to call ExcelFile.ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat)...[more] |
SetCellFromHtml | Enters an HTML formatted string into a cell, and tries to match the Excel formats with the HTML formatting tags. Note that the rich text inside Excel is more limited than xls (you are limited to only changing font attributes), so many tags from the HTML tags might be ignored. Whenever a tag is not understood or cannot be mapped into Excel, it will just be omitted. For a list of supported tags, see the Remarks section. |
GetHtmlFromCell | Returns the contents of formatted cell as HTML. Conditional formats are not applied (unless includeCellFormatting is true): you need to call ExcelFile.ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat) to the cell style to get the cell with cf applied. If...[more] |
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 ExcelFile.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 ExcelFile.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, Boolean) |
GetCellFormat | Overloaded GetCellFormat(Int32, Int32) GetCellFormat(Int32, Int32, Int32) |
ConditionallyModifyFormat | Modifies the format of the specified cell if it has a conditional format active. Returns a modified format with the applied conditional format if there was any change, null otherwise. |
GetConditionalFormat | One of the entries on the conditional format list of this file. |
SetConditionalFormat | Modifies one of the conditional format rules in the sheet. |
AddConditionalFormat | Adds a conditional format for a range of cells. |
ClearConditionalFormatsInSheet | Removes all conditional formats in the active sheet. |
RemoveConditionalFormat | Removes the conditional format at position index. |
GetStyleName | Gets the name of the style at position index. (1 based). |
GetStyle | Overloaded GetStyle(Int32) 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 ExcelFile.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 | Number of columns actually used on a given sheet. |
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, Boolean) SetRowFormat(Int32, TFlxFormat, TFlxApplyFormat, Boolean) |
GetColFormat | Overloaded GetColFormat(Int32) GetColFormat(Int32, Int32) |
SetColFormat | Overloaded SetColFormat(Int32, Int32, Boolean) 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, 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 ExcelFile.DefaultRowHeight this property returns the actual row height as Excel will show it, considering ExcelFile.DefaultRowHidden and ExcelFile.DefaultRowHeightAutomatic. See Excel Internal Units...[more] |
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 | Autofits a range of rows so they adapt their height to show all the text inside. Note that due to GDI+ / GDI incompatibilities, the height calculated by FlexCel will not be exactly the same than the one calculated by Excel. So when you open this workbook in Excel, Excel will re calculate the row heights to what it believes is best. You can change this behavior specifying keepHeightAutomatic = false. See also Fine Tuning Row Autofitting |
AutofitCol | Autofits a range of columns so they adapt their width to show all the text inside. |
AutofitRowsOnWorkbook | Autofits all the rows on all sheets on a workbook that are set to autofit so they adapt their height to show all the text inside. Note that due to GDI+ / GDI incompatibilities, the heights calculated by FlexCel will not be exactly the same than the ones calculated by Excel. So when you open this workbook in Excel, Excel might re calculate the row heights to what it believes is best. You can change this behavior specifying keepSizesAutomatic = false. See also Fine Tuning Row Autofitting...[more] |
MarkRowForAutofit | Marks a row as candidate for future autofit. Note that this method will NOT change anything on the file. It just "marks" the row so you can use it later with ExcelFile.AutofitMarkedRowsAndCols(Boolean, Boolean, Double). To change the actual autofit status on the xls file, use ExcelFile.SetAutoRowHeight...[more] |
MarkColForAutofit | Marks a column as candidate for future autofit. Note that this method will NOT change anything on the file. It just "marks" the column so you can use it later with ExcelFile.AutofitMarkedRowsAndCols(Boolean, Boolean, Double). |
IsRowMarkedForAutofit | Returns true is a row is marked for autofit. |
IsColMarkedForAutofit | Returns true is a column is marked for autofit. |
AutofitMarkedRowsAndCols | Autofits all the rows and columns on a sheet that have been previously marked with the ExcelFile.MarkRowForAutofit(Int32, Boolean, Double) and ExcelFile.MarkColForAutofit(Int32, Boolean, Double) methods. |
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) |
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 ExcelFile.GetColHidden instead you would have to call it 16384 times to get the same information. |
GetColorPalette | Returns a color from the color palette. This method will throw an exception if its "index" parameter is bigger than ExcelFile.ColorPaletteCount, (for example, for an automatic color). To get the real color, use ExcelFile.GetColorPalette(Int32, TUIColor) |
SetColorPalette | Changes a color on the Excel color palette. |
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. |
GetColorTheme | Overloaded GetColorTheme(TThemeColor) GetColorTheme(TPrimaryThemeColor) |
SetColorTheme | Overloaded SetColorTheme(TThemeColor, TDrawingColor) SetColorTheme(TPrimaryThemeColor, TDrawingColor) |
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 ExcelFile.SetColorTheme(TPrimaryThemeColor, TDrawingColor) and ExcelFile.GetColorTheme(TPrimaryThemeColor)...[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 ExcelFile.SetColorTheme(TPrimaryThemeColor, TDrawingColor) and ExcelFile.GetColorTheme(TPrimaryThemeColor)...[more] |
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 ExcelFile.GetNamedRange(Int32) to get the name definition, or directly call ExcelFile.GetNamedRange(String, Int32, Int32)...[more] |
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 ExcelFile.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. |
CopyToClipboardFormat | Copies a range on the active sheet to a clipboard stream, on the specified format. |
PasteFromTextClipboardFormat | Pastes the clipboard contents beginning on cells row, col. |
PasteFromXlsClipboardFormat | Pastes the clipboard contents beginning on cells row, col, with the option to convert formulas to their values. |
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 ExcelFile.PageHeader and ExcelFile.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 | This method returns the images associated to a given section of the header or footer. There can be only one image per section, and you refer it from the header string (see ExcelFile.PageHeader and ExcelFile.PageFooter) by writing &G. NOTE THAT YOU CAN ONLY USE HEADER AND FOOTER GRAPHICS ON EXCEL XP AND NEWER. Excel 2000 and 97 will still open the file, but they will show no graphics. |
GetHeaderOrFooterImageProperties | Returns the image position and size. |
SetHeaderOrFooterImage | This method sets the image associated to a given section of the header or footer. There can be only one image per section, and you refer it from the header string (see ExcelFile.PageHeader and ExcelFile.PageFooter) by writing &G. NOTE THAT YOU CAN ONLY USE HEADER AND FOOTER GRAPHICS ON EXCEL XP AND NEWER. Excel 2000 and 97 will still open the file, but they will show no graphics. ALSO, NOTE that only setting the image will not display it. You need to write &G in the corresponding...[more] |
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 ExcelFile.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 ExcelFile.GetPrinterDriverSettings to copy printer driver information from a file to another. |
SetImage | Sets the image data and / or image properties of an existing image. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use ExcelFile.SetImageAlternate |
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 | Sets the image properties of an existing image. |
GetImageName | Returns the image name at position imageIndex. |
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 ExcelFile.GetImageAlternate |
GetImageProperties | Returns image position and size. |
AddImage | Adds an image to the active sheet. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use ExcelFile.AddImageAlternate |
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 | Deletes the image at position imageIndex. Note that if the image is grouped, this will remove the full group. To remove a particular image inside a group, use ExcelFile.DeleteObject(Int32, String). |
ClearImage | Clears the image at position imageIndex, leaving an empty white box. |
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 ExcelFile.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. |
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. |
GetObjectAnchor | Returns the placement of the object. |
SetObjectAnchor | Sets the object placement. |
GetObjectProperties | Returns information on an object and all of its children. If the shape doesn't exist, this method returns null. |
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, Int64) SetObjectProperty(Int32, String, TShapeOption, Double) SetObjectProperty(Int32, String, TShapeOption, Boolean) SetObjectProperty(Int32, String, TShapeOption, String) 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 ExcelFile.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 | Deletes the graphic object at objectIndex. Use it with care, there are some graphics objects you don't want to remove (like comment boxes when you don't delete the associated comment.) |
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] |
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 ExcelFile.GetObjectLinkedCell instead. |
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. |
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 ExcelFile.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 ExcelFile.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 ExcelFile.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 | Adds a checkbox to the active sheet. |
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 | Adds a radio button to the active sheet. Call ExcelFile.AddGroupBox(TClientAnchor, TRichString) to insert a group box for grouping the radio buttons. |
AddGroupBox | Adds a Group box to the active sheet. Call ExcelFile.AddRadioButton(TClientAnchor, TRichString) to insert radio buttons inside the group box. |
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 | This method renders any object (chart, image, autoshape, etc) into an image, and returns it. |
RenderCells | This method renders a range of cells into an image, and returns it. No objects will be drawn on the cells, you can use ExcelFile.RenderObject(Int32) to draw those. Important note: By default this method will only render the text inside the cell, not the borders or cell fills or anything else. If you want to export an xls file to images, you need to set the parameter "exportObjects" to true, or use...[more] |
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, 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 | Changes the properties (text and position of the popup) for an existing comment at commentIndex. To delete a comment, set a "new TRichString()" as the "value" param. To add a new comment, use ExcelFile.SetComment(Int32, Int32, TRichString). |
SetComment | Sets or deletes a comment at the specified cell. |
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 | Inserts and/or copies a range of cells from one place to another. This method is one of the most important on FlexCel API, and it allows you to copy ranges of cells from one place to another, adapting the formulas, images and everything as Excel would do it. |
DeleteRange | Overloaded DeleteRange(TXlsCellRange, TFlxInsertMode) DeleteRange(Int32, Int32, TXlsCellRange, TFlxInsertMode, Boolean) |
MoveRange | Moves a range of cells, the same way Excel does it. All references pointing to the old range will be relocated to the new, and all existing references to the new range will be relocated to #ref. |
ClearDataValidation | Overloaded ClearDataValidation ClearDataValidation(TXlsCellRange) |
AddDataValidation | Adds a new Data Validation to a specified range. |
GetDataValidation | Returns the validation information for a specific cell. If the cell has no Data Validation associated, this method returns null. |
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 ExcelFile.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 ExcelFile.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 | Sets the Outline level for a row range. |
GetColOutlineLevel | Returns the Outline level for a column. |
SetColOutlineLevel | Sets the Outline level for a column range. |
CollapseOutlineRows | Collapses or expands the row outlines in a sheet to the specified level. It is equivalent to pressing the numbers at the top of the outline gutter in Excel. |
CollapseOutlineCols | Collapses or expands the column outlines in a sheet to the specified level. It is equivalent to pressing the numbers at the top of the outline gutter in Excel. |
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 (ExcelFile.IsOutlineNodeRow is false) this method does nothing. While this method allows a better control of the rows expanded and collapsed, you will normally use ExcelFile.CollapseOutlineRows(Int32, TCollapseChildrenMode)...[more] |
CollapseOutlineNodeCol | Use this method to collapse a node of the outline. If the column is not a node (ExcelFile.IsOutlineNodeCol is false) this method does nothing. While this method allows a better control of the columns expanded and collapsed, you will normally use ExcelFile.CollapseOutlineCols(Int32, TCollapseChildrenMode)...[more] |
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 ExcelFile.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. |
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 ExcelFile.SelectCell This property can work in different windows depending on the value of ExcelFile.ActiveWindow |
GetSelectedCells | Returns the selected ranges on a sheet. This property can work in different windows depending on the value of ExcelFile.ActiveWindow |
ScrollWindow | Scrolls the window to a specified place. This property can work in different windows depending on the value of ExcelFile.ActiveWindow |
GetWindowScroll | Returns the window scroll for a specified pane. This property can work in different windows depending on the value of ExcelFile.ActiveWindow |
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 ExcelFile.SplitWindow the panes are suppressed and vice-versa See also ExcelFile.GetFrozenPanes This property can work in different windows depending on the value of ExcelFile.ActiveWindow...[more] |
GetFrozenPanes | Returns the cell that is freezing the window, "A1" if no panes are frozen. See also ExcelFile.FreezePanes This property can work in different windows depending on the value of ExcelFile.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 ExcelFile.FreezePanes the windows are unsplitted and vice-versa See also ExcelFile.GetSplitWindow This property can work in different windows depending on the value of ExcelFile.ActiveWindow...[more] |
GetSplitWindow | Returns the horizontal and vertical offsets for the split windows. Zero means no split. See also ExcelFile.SplitWindow This property can work in different windows depending on the value of ExcelFile.ActiveWindow |
GetDataConnections | Returns the data connections in the file. Use ExcelFile.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 | Replaces the instances of oldValue by newValue in the active sheet, and allows to specify the cell format and value for every replaced cell. |
Sort | Sorts a range on the current sheet. |
SetAutoFilter | Sets the AutoFilter in the Active sheet to point to the range specified. Note: You will normally want to use ExcelFile.SetAutoFilter(Int32, Int32, Int32), since that is the common way to set autofilters. The last row shouldn't matter, so it will addapt automatically when you add rows. If you specify the last row, then the range will still grow to include all data, but it will include at least the last row you specify, even if it is blank."/> |
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 | When ExcelFile.RecalcMode is manual, use this method to force a recalculation of the spreadsheet. |
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. |
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 ExcelFile.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....[more] |
StartBatchRecalcCells | This method tells FlexCel that you are going to call multiple times ExcelFile.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 ExcelFile.EndBatchRecalcCells. |
EndBatchRecalcCells | This method ends the batch started by ExcelFile.StartBatchRecalcCells and goes back to normal mode. |
RecalcExpression | Calculates the value of any formula and returns the result. The expression must be a valid Excel formula, it must start with "=", and cell references that don't specify a sheet (like for example "=A2") will refer to the active sheet. Cells used by the formula will be recalculated as needed too. You can use this method as a simple calculator, or to calculate things like the sum of a range of cells in the spreadsheet. Look at the example for more information on how to use it. Note that we will consider the expression to be located in the cell A1 of the Active sheet. So for example "=ROW()" will return 1, and "=A2" will return the value of A2 in the active sheet. |
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 ExcelFile.RecalcExpression(String)...[more] |
GetWhatIfTableList | Returns a list of the upper cells of the What-if tables in the page. You can then use ExcelFile.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 | Use it to convert formulas to their values. It can be useful if for example you are copying the sheet to another workbook, and you don't want any references to it. NOTE: You will probably want to use ExcelFile.ConvertExternalNamesToRefErrors(Boolean) too, to convert named ranges besides the formulas. Also note that if you want to convert a whole file, you need to call ConvertFormulasToValues in every sheet. |
ConvertExternalNamesToRefErrors | Use it to convert the external names in a sheet to #REF! . It can be useful when you need to remove all external links in a file. NOTE: You will probably want to use ExcelFile.ConvertFormulasToValues(Boolean) too. |
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] |
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. |
EvaluateUserDefinedFunction | Evaluates a custom function you have added earlier with ExcelFile.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 ExcelFile.AddUserDefinedFunction, this method will return TFlxFormulaErrorValue.ErrName...[more] |
IsDefinedFunction | Returns true if the Custom formula function has been added to the FlexCel recalculating engine. Note that internal functions are not returned by this method, but user defined functions pre-defined in FlexCel will be. |
RemoveMacros | If the file has macros, this method will remove them. |
HasMacros | Returns true if the file has any macros. |
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. |
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. |
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 ExcelFile.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(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 ExcelFile.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 |
GetCustomXmlPart | Returns the part at the given position. (1 based) |
RemoveCustomXmlPart | Deletes 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 ExcelFile.GetXmlMap, modify it, then set it with ExcelFile.SetXmlMap |
GetFormulaTokens | Returns the formula of a cell as an RPN list of tokens that you can use to analyze it. If the cell doesn't have a formula, then this method will return null. Note that the result is an RPN expression, so for example the formula "= 1 * 2 + 3" would be returned as "1, 2, *, 3, +". While the formula "= 1 * (2 + 3)" would be returned as "1, 2, 3, +, *" See Using Tokens for more information. |
GetTokens | Returns the tokens for a formula in text form. See ExcelFile.GetFormulaTokens(Int32, Int32) for more information. |
SetFormulaTokens | Sets a cell with the formula specified by its tokens. Normally you will get the tokens by modifying the result of ExcelFile.GetFormulaTokens(Int32, Int32) |
SetTokens | This method converts a list of tokens in the corresponding string. Normally you get the tokens from ExcelFile.GetTokens or ExcelFile.GetFormulaTokens(Int32, Int32) |
Properties
Name | Description |
---|---|
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. |
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 ExcelFile.ActiveWindow. Note that this won't change the active sheet for FlexCel when you enter a value, you still need to call ExcelFile.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. |
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 ExcelFile.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] |
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. |
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 ExcelFile.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 ExcelFile.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 ExcelFile.GetSheetIndexFromID to retrieve a sheet after deleting or adding sheets. While normally you can use ExcelFile.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....[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 ExcelFile.SheetView This property can work in different windows depending on the value of ExcelFile.ActiveWindow...[more] |
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 ExcelFile.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 ExcelFile.SheetZoom This property can work in different windows depending on the value of ExcelFile.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 ExcelFile.SheetOptions |
ShowGridLines | True if the gray grid lines are shown on the Active sheet. You can also set this option with ExcelFile.SheetOptions This property can work in different windows depending on the value of ExcelFile.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 ExcelFile.SheetOptions by changing TSheetOptions.ShowRowAndColumnHeaders This property can work in different windows depending on the value of ExcelFile.ActiveWindow |
ShowFormulaText | When true, the formula text will be displayed instead of the formula value. You can also set this option with ExcelFile.SheetOptions This property can work in different windows depending on the value of ExcelFile.ActiveWindow |
GridLinesColor | Color of the grid separator lines. This property can work in different windows depending on the value of ExcelFile.ActiveWindow |
HideZeroValues | When true number 0 will be shown as empty. You can also set this option with ExcelFile.SheetOptions This property can work in different windows depending on the value of ExcelFile.ActiveWindow |
SheetType | Use this property to know it the ExcelFile.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 ExcelFile.SheetWindowOptions for options that affect all sheets. This property can work in different windows depending on the value of...[more] |
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 ExcelFile.SheetOptions for options that affect only the active sheet. This property can work in different windows depending on the value of ExcelFile.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. |
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. |
FontCount | Number of fonts defined in all the sheet. When calling GetFont(fontIndex), 0<=fontIndex<FormatCount. |
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 ExcelFile.GetConditionalFormat |
StyleCount | Returns the number of named styles in the file. |
CellMergedListCount | For using with ExcelFile.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 ExcelFile.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 ExcelFile.ColCountInRow(Int32)...[more] |
ColFormatCount | Returns the number of formatted columns in the file. Note that in xlsx files this number can be very big. |
ColCountOnlyData | While ExcelFile.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 ExcelFile.DefaultRowHeightAutomatic = false. To get the real default row height Excel will use when ExcelFile.DefaultRowHeightAutomatic = true or ExcelFile.DefaultRowHidden...[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 ExcelFile.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. |
GetUsedPaletteColors | Returns a list of the used colors on the palette. You can use it as an entry to ExcelFile.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 ExcelFile.GetPageHeaderAndFooter and ExcelFile.SetPageHeaderAndFooter. A page header is a string that contains the text for the 3 parts of the header....[more] |
PageFooter | Page footer on the active sheet. For a description on the format of the string, see ExcelFile.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 ExcelFile.PrintNumberOfHorizontalPages x ExcelFile.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 ExcelFile.PrintLandscape |
PrintOptionsInitializedFromPrinter | If this property is false, then Excel has not read the printer options from the printer, and ExcelFile.PrintLandscape, ExcelFile.PrintPaperSize, ExcelFile.PrintScale, ExcelFile.PrintXResolution, ExcelFile.PrintYResolution...[more] |
PrintLandscape | If true, page will be printed landscape, else portrait. This property modifies ExcelFile.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 ExcelFile.PrintOptions |
PrintDraftQuality | If true, the pages will be printed in draft quality. This property modifies ExcelFile.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 ExcelFile.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 ExcelFile.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 ExcelFile.SetPrinterDriverSettings |
PrintPaperDimensions | Returns the dimensions for the selected paper. See also ExcelFile.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. |
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. |
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 ExcelFile.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 ExcelFile.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 ExcelFile.OptionsRecalcMaxIterations is reached or the difference is less than ExcelFile.OptionsRecalcMaxChange |
OptionsRecalcMaxIterations | Maximum number of iterations when calculating circular references (ExcelFile.OptionsRecalcCircularReferences is true), |
OptionsRecalcMaxChange | Maximum difference between 2 iterations when calculating circular references (ExcelFile.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. |
OptionsForceUseCheckCompatibility | When the option ExcelFile.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", ExcelFile.OptionsCheckCompatibility is ignored by FlexCel. In order to force FlexCel to save ExcelFile.OptionsCheckCompatibility...[more] |
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] |
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 ExcelFile.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 ExcelFile.OptionsRecalcMode instead. |
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 | Internal use. |
Recalculating | Internal use. |
LinkCount | Returns the number of external links for the file. You can access those links with ExcelFile.GetLink and ExcelFile.SetLink |
HeightCorrection | Factor to multiply default row heights. See remarks for a detailed explanation. |
FileFormatWhenOpened | Returns the file format that the file had when it was opened. If the file was created with ExcelFile.NewFile, the file format when opened is xls. |
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. |
WidthCorrection | Factor to multiply default column widths. See remarks for a detailed explanation. |
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 ExcelFile.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 ExcelFile.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. |
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] |
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 ExcelFile.GetTable(Int32) to retrieve the tables in the sheet. |
CustomXmlPartCount | Returns the number of custom xml parts in the active document. |