wxAutoExcel 2.5.1
Loading...
Searching...
No Matches
wxAutoExcel::wxExcelRange Class Reference

Represents Microsoft Excel Range, i.e. More...

#include <wxAutoExcelRange.h>

Inheritance diagram for wxAutoExcel::wxExcelRange:
wxAutoExcel::wxExcelRangeOwner wxAutoExcel::wxExcelObject

Public Types

typedef wxExcelCollectionIterator< wxExcelRange, wxExcelRange > iterator
 The iterator over the items of the range, see begin().
Public Types inherited from wxAutoExcel::wxExcelObject
enum  ErrorFlags {
  Err_DoNothing = 0 , Err_LogOnInvalidDispatch = 1 , Err_AssertOnInvalidDispatch = 1 << 1 , Err_ThrowOnInvalidDispatch = 1 << 2 ,
  Err_LogOnInvalidArgument = 1 << 3 , Err_AssertOnInvalidArgument = 1 << 4 , Err_ThrowOnInvalidArgument = 1 << 5 , Err_LogOnFailedInvoke = 1 << 6 ,
  Err_AssertOnFailedInvoke = 1 << 7 , Err_ThrowOnFailedInvoke = 1 << 8 , Err_LogOnInvalidReturnType = 1 << 9 , Err_AssertOnInvalidReturnType = 1 << 10 ,
  Err_ThrowOnInvalidReturnType = 1 << 11 , Err_LogOnOtherError = 1 << 12 , Err_AssertOnOtherError = 1 << 13 , Err_ThrowOnOtherError = 1 << 14
}
 Flags affecting the behaviour of wxExcelObject and its descendants when an error occurs during accessing an Excel object property or calling its method. More...

Public Member Functions

bool Activate ()
 Activates a single cell, which must be inside the current selection.
wxExcelComment AddComment (const wxString &text=wxEmptyString)
 Adds a comment to the range.
wxExcelCommentThreaded AddCommentThreaded (const wxString &text)
 Adds a threaded comment to the range.
bool AdvancedFilter (enum XlFilterAction action, wxExcelRange *criteriaRange=NULL, wxExcelRange *copyToRange=NULL, wxXlTribool unique=wxDefaultXlTribool)
 Filters or copies data from a list based on a criteria range.
void AllocateChanges ()
 Performs a writeback operation for all edited cells in a range based on an OLAP data source.
void ApplyNames (wxArrayString *names=NULL, wxXlTribool ignoreRelativeAbsolute=NULL, wxXlTribool useRowColumnNames=wxDefaultXlTribool, wxXlTribool omitColumn=wxDefaultXlTribool, wxXlTribool omitRow=wxDefaultXlTribool, XlApplyNamesOrder *order=NULL, wxXlTribool appendLast=wxDefaultXlTribool)
 Applies names to the cells in the specified range.
void ApplyOutlineStyles ()
 Applies outlining styles to the specified range.
wxString AutoComplete (const wxString &str)
 Returns an AutoComplete match from the list.
bool AutoFill (wxExcelRange destination, XlAutoFillType *type=NULL)
 Performs an autofill on the cells in the specified range.
bool AutoFilter (long *field=NULL, const wxString &criteria1=wxEmptyString, XlAutoFilterOperator *oper=NULL, const wxString &criteria2=wxEmptyString, wxXlTribool visibleDropDown=wxDefaultXlTribool)
 Filters a list using the AutoFilter.
bool AutoFit ()
 Changes the width of the columns in the range or the height of the rows in the range to achieve the best fit.
void AutoOutline ()
 Automatically creates an outline for the specified range.
bool BorderAround (XlLineStyle *lineStyle=NULL, XlBorderWeight *weight=NULL, long *colorIndex=NULL, const wxColour *color=NULL)
 Adds a border to a range and sets the Color, LineStyle, and Weight properties for the new border.
void Calculate ()
 Calculates the range.
void CalculateRowMajorOrder ()
 Calculates the range the same way Excel 2000 and earlier did.
void CheckSpelling (const wxString &customDictionary=wxEmptyString, wxXlTribool ignoreUpperCase=wxDefaultXlTribool, wxXlTribool alwaysSuggest=wxDefaultXlTribool, MsoLanguageID *spellLang=NULL)
 Checks the spelling of an object.
bool Clear ()
 Clears the entire object.
bool ClearComments ()
 Clears all cell comments from the specified range.
bool ClearContents ()
 Clears the formulas from the range.
bool ClearFormats ()
 Clears the formatting of the object.
bool ClearHyperlinks ()
 Removes all hyperlinks from the specified range.
bool ClearNotes ()
 Clears notes and sound notes from all the cells in the specified range.
bool ClearOutline ()
 Clears the outline for the specified range.
wxExcelRange ColumnDifferences (wxExcelRange comparison)
 Returns a Range Represents all the cells whose contents are different from the comparison cell in each column.
bool Copy (const wxExcelRange *destination=NULL)
 Copies the range to the specified range or to the Clipboard.
bool CopyPicture (XlPictureAppearance *appearance=NULL, XlCopyPictureFormat *format=NULL)
 Copies the selected object to the Clipboard as a picture.
bool CreateNames (wxXlTribool top=wxDefaultXlTribool, wxXlTribool left=wxDefaultXlTribool, wxXlTribool bottom=wxDefaultXlTribool, wxXlTribool right=wxDefaultXlTribool)
 Creates names in the specified range, based on text labels in the sheet.
bool Cut (const wxExcelRange *destination=NULL)
 Cuts the object to the Clipboard or pastes it into a specified destination.
bool DataSeries (XlRowCol *rowCol=NULL, XlDataSeriesType *type=NULL, XlDataSeriesDate *date=NULL, long *step=NULL, const wxVariant &stop=wxNullVariant, wxXlTribool trend=wxDefaultXlTribool)
 Creates a data series in the specified range.
bool Delete (XlDeleteShiftDirection *shift=NULL)
 Deletes the object.
void Dirty ()
 Designates a range to be recalculated when the next recalculation occurs.
void DiscardChanges ()
 Discards all changes in the edited cells of the range.
void ExportAsFixedFormat (XlFixedFormatType type, const wxString &fileName=wxEmptyString, XlFixedFormatQuality *quality=NULL, wxXlTribool includeDocProperties=wxDefaultXlTribool, wxXlTribool ignorePrintAreas=wxDefaultXlTribool, long *from=NULL, long *to=NULL, wxXlTribool openAfterPublish=wxDefaultXlTribool)
 Exports to an XPS or PDF file.
bool FillDown ()
 Fills down from the top cell or cells in the specified range to the bottom of the range.
bool FillLeft ()
 Fills left from the rightmost cell or cells in the specified range.
bool FillRight ()
 Fills right from the leftmost cell or cells in the specified range.
bool FillUp ()
 Fills up from the bottom cell or cells in the specified range to the top of the range.
wxExcelRange Find (const wxVariant &what, wxExcelRange *after=NULL, XlFindLookIn *lookIn=NULL, XlLookAt *lookAt=NULL, XlSearchOrder *searchOrder=NULL, XlSearchDirection *searchDirection=NULL, wxXlTribool matchCase=wxDefaultXlTribool, wxXlTribool matchByte=wxDefaultXlTribool, wxXlTribool searchFormat=wxDefaultXlTribool)
 Finds specific information in a range, returns the first cell where the information is found, or an invalid range (see wxExcelObject::IsOk_()) when no match is found, which is not an error.
wxExcelRange FindNext (wxExcelRange *after=NULL)
 Continues a search that was begun with Find(), returns the next cell matching the same conditions, which may be the first one found when the search wraps around the range, or an invalid range when no match is found.
wxExcelRange FindPrevious (wxExcelRange *after=NULL)
 Continues a search that was begun with Find(), returns the previous cell matching the same conditions, or an invalid range when no match is found.
void FlashFill ()
 Flash Fill automatically fills the data when it senses a pattern.
void FunctionWizard ()
 Starts the Function Wizard for the upper-left cell of the range.
bool Group ()
 Demotes a range in an outline (that is, increases its outline level).
bool Insert (XlInsertShiftDirection *shift)
 Inserts a cell or a range of cells into the worksheet or macro sheet and shifts other cells away to make space.
void InsertIndent (long insertAmount)
 Adds an indent to the specified range.
bool Justify ()
 Rearranges the text in a range so that it fills the range evenly.
bool ListNames ()
 Pastes a list of all nonhidden names onto the worksheet, beginning with the first cell in the range.
void Merge (wxXlTribool across=wxDefaultXlTribool)
 Creates a merged cell from the specified Range object.
bool NavigateArrow (wxXlTribool towardPrecedent=wxDefaultXlTribool, long *arrowNumber=NULL, long *linkNumber=NULL)
 Navigates a tracer arrow for the specified range to the precedent, dependent, or error-causing cell or cells.
bool PasteSpecial (XlPasteType *paste=NULL, XlPasteSpecialOperation *operation=NULL, wxXlTribool skipBlanks=wxDefaultXlTribool, wxXlTribool transpose=wxDefaultXlTribool)
 Pastes a Range from the Clipboard into the specified range.
bool PrintOut (long *from=NULL, long *to=NULL, long *copies=NULL, wxXlTribool preview=wxDefaultXlTribool, const wxString &activePrinter=wxEmptyString, wxXlTribool printToFile=wxDefaultXlTribool, wxXlTribool collate=wxDefaultXlTribool, const wxString &prToFileName=wxEmptyString)
 Prints the object.
bool PrintPreview (wxXlTribool enableChanges=wxDefaultXlTribool)
 Shows a preview of the object as it would look when printed.
void RemoveDuplicates (const wxArrayLong &columns, XlYesNoGuess *header=NULL)
 Removes duplicate values from a range of values.
void RemoveSubtotal ()
 Removes subtotals from a list.
bool Replace (const wxVariant &what, const wxVariant &replacement, XlLookAt *lookAt=NULL, XlSearchOrder *searchOrder=NULL, wxXlTribool matchCase=wxDefaultXlTribool, wxXlTribool matchByte=wxDefaultXlTribool, wxXlTribool searchFormat=wxDefaultXlTribool, wxXlTribool replaceFormat=wxDefaultXlTribool)
 Replaces what with replacement in the cells of the range.
wxExcelRange RowDifferences (wxExcelRange comparison)
 Returns a Range Represents all the cells whose contents are different from those of the comparison cell in each row.
bool Select ()
 Selects the object.
bool Show ()
 Scrolls through the contents of the active window to move the range into view.
bool ShowDependents (wxXlTribool remove=wxDefaultXlTribool)
 Draws tracer arrows to the direct dependents of the range.
wxExcelRange ShowErrors ()
 Draws tracer arrows through the precedents tree to the cell that's the source of the error, and returns the range that contains that cell.
bool ShowPrecedents (wxXlTribool remove=wxDefaultXlTribool)
 Draws tracer arrows to the direct precedents of the range.
wxExcelRange SpecialCells (XlCellType type, const wxVariant &value=wxNullVariant)
 Returns a Range Represents all the cells that match the specified type and value.
bool Subtotal (XlConsolidationFunction groupBy, XlConsolidationFunction function, wxArrayLong &totalList, wxXlTribool replace=wxDefaultXlTribool, wxXlTribool pageBreaks=wxDefaultXlTribool, XlSummaryRow *summaryBelowData=NULL)
 Creates subtotals for the range (or the current region, if the range is a single cell).
void Table (wxExcelRange *rowInput=NULL, wxExcelRange *columnInput=NULL)
 Creates a data table based on input values and formulas that you define on a worksheet.
bool Ungroup ()
 Promotes a range in an outline (that is, decreases its outline level).
void UnMerge ()
 Separates a merged area into individual cells.
bool GetAddIndent ()
 True if text is automatically indented when the text alignment in a cell is set to equal distribution (either horizontally or vertically.); MSDN documentation for Range.AddIndent.
void SetAddIndent (bool addIndent)
 True if text is automatically indented when the text alignment in a cell is set to equal distribution (either horizontally or vertically.); MSDN documentation for Range.AddIndent.
wxString GetAddress (wxXlTribool rowAbsolute=wxDefaultXlTribool, wxXlTribool columnAbsolute=wxDefaultXlTribool, XlReferenceStyle *referenceStyle=NULL, wxXlTribool external=wxDefaultXlTribool, wxExcelRange *relativeTo=NULL)
 Returns a value that represents the range reference in the language of the macro.
wxString GetAddressLocal (wxXlTribool rowAbsolute=wxDefaultXlTribool, wxXlTribool columnAbsolute=wxDefaultXlTribool, XlReferenceStyle *referenceStyle=NULL, wxXlTribool external=wxDefaultXlTribool, wxExcelRange *relativeTo=NULL)
 Returns the range reference for the specified range in the language of the user.
bool GetAllowEdit ()
 True if the range can be edited on a protected worksheet.
wxExcelAreas GetAreas ()
 Returns an Areas collection that represents all the ranges in a multiple-area selection.
wxExcelBorders GetBorders ()
 Returns a Borders collection that represents the borders of a style or a range of cells (including a range defined as part of a conditional format).
wxExcelCharacters GetCharacters (long start=1, long *length=NULL)
 Returns a Characters Represents a range of characters within the object text.
long GetColumn ()
 Returns the number of the first column in the first area in the specified range.
double GetColumnWidth ()
 If all columns in the range have same width returns the width in points else returns -1.
void SetColumnWidth (double colWidth)
 Sets the column width for all the columns in the range.
wxExcelComment GetComment ()
 Returns a comment associated with the cell in the upper-left corner of the range.
wxExcelCommentThreaded GetCommentThreaded ()
 Returns a CommentThreaded object that represents the threaded comment associated with the cell in the upper-left corner of the range.
long GetCount ()
 Returns a value that represents the number of cells in the range.
wxLongLong GetCountLarge ()
 Returns a value that represents the number of cells in the range.
wxExcelRange GetCurrentArray ()
 If the specified cell is part of an array, returns a Range Represents the entire array.
wxExcelRange GetCurrentRegion ()
 Returns a Range Represents the current region.
wxExcelRange GetDependents ()
 Returns a Range Represents the range containing all the dependents of a cell.
wxExcelRange GetDirectDependents ()
 Returns a Range Represents the range containing all the direct dependents of a cell.
wxExcelRange GetDirectPrecedents ()
 Returns a Range Represents the range containing all the direct precedents of a cell.
wxExcelDisplayFormat GetDisplayFormat ()
 Returns a DisplayFormat object that represents the display settings for the range, including the formatting applied by conditional formatting.
wxExcelRange GetEnd (XlDirection direction)
 Returns a Range Represents the cell at the end of the region that contains the source range.
wxExcelRange GetEntireColumn ()
 Returns a Range Represents the entire column (or columns) that contains the specified range.
wxExcelRange GetEntireRow ()
 Returns a Range Represents the entire row (or rows) that contains the specified range.
wxExcelErrors GetErrors ()
 Allows the user to to access error checking options.
wxExcelFont GetFont ()
 Returns a Font Represents the font of the specified object.
wxExcelFormatConditions GetFormatConditions ()
 Returns a FormatConditions collection that represents all the conditional formats for the specified range.
wxString GetFormula ()
 Returns the formula of a single cell, in A1-style notation and in the language of the macro.
bool GetFormula (wxVariant &formulas)
 Returns the formulas of all cells in the range, in A1-style notation and in the language of the macro.
void SetFormula (const wxVariant &formula)
 Sets the formula of all cells in the range, in A1-style notation and in the language of the macro.
wxString GetFormulaArray ()
 Returns the array formula of a range.
void SetFormulaArray (const wxString &formula)
 Sets the array formula of a range.
wxXlTribool GetFormulaHidden ()
 Whether the formula will be hidden when the worksheet is protected.
void SetFormulaHidden (const bool hidden)
 True if the formula will be hidden when the worksheet is protected.
wxString GetFormulaLocal ()
 Returns the formula of a single cell, using A1-style references in the language of the user.
bool GetFormulaLocal (wxVariant &formulas)
 Returns the formulas of all cells in the range, using A1-style references in the language of the user.
void SetFormulaLocal (const wxVariant &formulaLocal)
 Sets the formula of all cells in the range, using A1-style references in the language of the user.
wxString GetFormulaR1C1 ()
 Returns the formula of a single cell, using R1C1-style notation in the language of the macro.
bool GetFormulaR1C1 (wxVariant &formulas)
 Returns the formulas of all cells in the range, using R1C1-style notation in the language of the macro.
void SetFormulaR1C1 (const wxVariant &formulaR1C1)
 Sets the formula of all cells in the range, using R1C1-style notation in the language of the macro.
wxString GetFormulaR1C1Local ()
 Returns the formula of a single cell, using R1C1-style notation in the language of the user.
bool GetFormulaR1C1Local (wxVariant &formulas)
 Returns the formulas of all cells in the range, using R1C1-style notation in the language of the user.
void SetFormulaR1C1Local (const wxVariant &formulaR1C1Local)
 Sets the formula of all cells in the range, using R1C1-style notation in the language of the user.
wxXlTribool GetHasArray ()
 True if the specified cell is part of an array formula.
wxXlTribool GetHasFormula ()
 Returns tb_true if all cells in the range contain formulas, tb_false if none of the cells in the range contains a formula, and tb_default otherwise.
double GetHeight ()
 The range height in points.
bool GetHidden ()
 If true the rows or columns are hidden.
void SetHidden (bool hidden)
 If true the rows or columns are hidden.
long GetHorizontalAlignment ()
 Horizontal alignment for the range.
void SetHorizontalAlignment (const long alignment)
 Horizontal alignment for the range.
wxExcelHyperlinks GetHyperlinks ()
 Returns a Hyperlinks collection that represents the hyperlinks for the range.
wxString GetID ()
 The identifying label for the specified cell when the page is saved as a Web page.
void SetID (const wxString &ID)
 The identifying label for the specified cell when the page is saved as a Web page.
long GetIndentLevel ()
 The indent level for the range.
void SetIndentLevel (long indentLevel)
 The indent level for the range.
wxExcelInterior GetInterior ()
 Returns an Interior Represents the interior of the range.
wxExcelRange GetItem (long rowIndex, long *columnIndex=NULL)
 Returns a Range Represents a range at an offset to the specified range.
wxExcelRange operator[] (long index)
 Returns the item of the range at index, starting from 1, as Item with a single argument does in VBA: a cell, counting across the rows, for a range of cells, a row for a range returned by GetRows(), or a column for a range returned by GetColumns().
double GetLeft ()
 Returns the distance, in points, from the left edge of column A to the left edge of the range.
long GetListHeaderRows ()
 Returns the number of header rows for the specified range.
wxExcelListObject GetListObject ()
 Returns a ListObject for Range.
XlLocationInTable GetLocationInTable ()
 Returns a constant that describes the part of the PivotTable report that contains the upper-left corner of the specified range.
wxXlTribool GetLocked ()
 Returns tb_true if all cells in the range are locked, tb_true if all cells in the range are unlocked, and tb_default is some cells are locked and some are not.
void SetLocked (bool locked)
 Sets a value that indicates if the object is locked.
wxString GetMDX ()
 Returns the MDX name for the specified Range object.
wxExcelRange GetMergeArea ()
 Returns a Range Represents the merged range containing the specified cell.
bool GetMergeCells ()
 True if the range contains merged cells.
void SetMergeCells (bool mergeCells)
 Merges the cells of each area of the range when true, unmerges them when false.
wxExcelName GetName ()
 Returns the name of the object.
void SetName (const wxString &name)
 Sets the name of the object.
wxExcelRange GetNext ()
 Returns a range representing the next cell.
wxString GetNumberformat ()
 Returns the format code for the range or an empty string if all the cells in range don't share the same format.
void SetNumberformat (const wxString &numberFormat)
 Sets the format code for the range.
wxString GetNumberformatLocal ()
 Returns the format code for the range as a string in the language of the user or an empty string if all the cells in range don't share the same format.
void SetNumberformatLocal (const wxString &numberFormatLocal)
 Sets the format code for the range as a string in the language of the user.
wxExcelRange GetOffset (long rowOffset=0, long columnOffset=0)
 Returns a Range Represents a range that's offset from the specified range.
long GetOrientation ()
 Returns the text orientation.
void SetOrientation (long orientation)
 Sets the text orientation.
long GetOutlineLevel ()
 Returns the current outline level of the specified row or column.
void SetOutlineLevel (long outlineLevel)
 Sets the current outline level of the specified row or column.
XlPageBreak GetPageBreak ()
 Returns the location of a page break.
void SetPageBreak (XlPageBreak pageBreak)
 Sets the location of a page break.
wxExcelRange GetPrecedents ()
 MSDN documentation for Range.Precedents.
wxString GetPrefixCharacter ()
 Returns the prefix character for the cell.
wxExcelRange GetPrevious ()
 Returns a range represnting the next cell.
long GetReadingOrder ()
 Returns the reading order for the specified object.
void SetReadingOrder (long readingOrder)
 Sets the reading order for the specified object, xlRTL (right-to-left), xlLTR (left-to-right), or xlContext.
wxExcelRange GetResize (long *rowSize=NULL, long *columnSize=NULL)
 Resizes the specified range.
long GetRow ()
 Returns the number of the first row of the first area in the range.
double GetRowHeight ()
 If all rows in the range have same height returns the height in points else returns -1.
void SetRowHeight (double rowHeight)
 Sets the height of all the rows in the range specified, measured in points.
bool GetShowDetail ()
 True if the outline is expanded for the specified range (so that the detail of the column or row is visible).
void SetShowDetail (bool showDetail)
 Expands the outline for the specified range when true, collapses it when false.
wxXlTribool GetShrinkToFit ()
 Returns tb_true if the text shrinks to fit into the cell in all cells in the range.
void SetShrinkToFit (bool shrinkToFit)
 Set true if the text is to fit into the cell.
wxExcelSparklineGroups GetSparklineGroups ()
 Returns a SparklineGroups object that represents an existing group of sparklines from the specified range.
wxExcelStyle GetStyle ()
 Returns the style of the range.
void SetStyle (wxExcelStyle style)
 Sets the style of the range.
bool GetSummary ()
 True if the range is an outlining summary row or column.
wxString GetText ()
 Returns the text value as seen by user in MS Excel.
double GetTop ()
 Returns the distance, in points, from the top edge of row 1 to the top edge of the range.
wxXlTribool GetUseStandardHeight ()
 Returns tb_true if the row height of the Range object equals the standard height of the sheet.
void SetUseStandardHeight (bool useStandardHeight)
 Whether all cells in the range should use standard row height of the sheet.
wxXlTribool GetUseStandardWidth ()
 Returns tb_true if the column width of the Range object equals the standard width of the sheet.
void SetUseStandardWidth (bool useStandardWidth)
 Whether all cells in the range should use standard column width of the sheet.
wxExcelValidation GetValidation ()
 Returns the Validation object that represents data validation for the specified range.
wxVariant GetValue ()
 Returns the value(s) of the specified range.
 operator wxVariant ()
 Same as calling GetValue();.
void SetValue (const wxVariant &value)
 Sets the value for a Range.
void operator= (const wxVariant &value)
 Same as calling SetValue();.
wxVariant GetValue2 ()
 Works almost like GetValue(), except that it returns DateTime and Currency as doubles and not their respective types.
void SetValue2 (const wxVariant &value)
 Sets the cell value.
long GetVerticalAlignment ()
 Returns the vertical alignment of the specified object.
void SetVerticalAlignment (long verticalAlignment)
 Sets the vertical alignment of the specified object.
double GetWidth ()
 Returns the width, in units, of the range.
wxExcelWorksheet GetWorksheet ()
 Returns the worksheet containing the specified range.
wxXlTribool GetWrapText ()
 Returns tb_true if all cells in the range wrap the text, tb_false if all cells in the range do not wrap the text, and tb_default if some cells wrap the text and some do not.
void SetWrapText (bool wrapText)
 Set to true if Microsoft Excel should wrap the text in the object in all cells in the range.
virtual wxString GetAutoExcelObjectName_ () const
 Returns "Range".
long GetConvertVariantFlags_ ()
 See wxAutomationObject::GetConvertVariantFlags().
bool SetConvertVariantFlags_ (long flags)
 This method, wrapping wxAutomationObject::SetConvertVariantFlags() can be very useful for efficient data transfer to/from Excel, using wxOleConvertVariant_ReturnSafeArrays as a value of flags, see bulkdata sample for an example.
bool GetValues_ (wxExcelRangeData &data, bool value2=true)
 Gets the values of all cells of the range at once.
bool SetValues_ (const wxExcelRangeData &data, bool value2=true)
 Sets the values of all cells of the range at once.
bool GetFormulas_ (wxExcelRangeData &data)
 Gets the formulas of all cells of the range at once, in A1-style notation and in the language of the macro.
bool SetFormulas_ (const wxExcelRangeData &data)
 Sets the formulas of all cells of the range at once, in A1-style notation and in the language of the macro.
bool FindAll_ (const wxVariant &what, wxExcelRangeVector &found, XlFindLookIn *lookIn=NULL, XlLookAt *lookAt=NULL, XlSearchOrder *searchOrder=NULL, wxXlTribool matchCase=wxDefaultXlTribool, wxXlTribool matchByte=wxDefaultXlTribool, wxXlTribool searchFormat=wxDefaultXlTribool)
 Finds all the cells of the range matching the conditions, using Find() and FindNext(), and puts them into found, in the order of searchOrder, starting with the cell in the upper-left corner of the range.
iterator begin ()
 Returns the iterator referring to the first item of the range, or past the last item, which allows iterating over the items with a range-based for loop, see wxExcelCollectionIterator.
Public Member Functions inherited from wxAutoExcel::wxExcelRangeOwner
wxExcelRange GetCells (long *row=NULL, long *column=NULL)
 wxExcelApplication: Returns a Range representing all the cells on the active worksheet.
wxExcelRange GetRange (const wxString &cell1, const wxString &cell2=wxEmptyString)
 wxExcelWorksheet: Returns a Range representing a cell or a range of cells.
wxExcelRange GetRows ()
 wxExcelWorksheet: Returns a Range representing all the rows on the specified worksheet.
wxExcelRange GetRows (long rowIndex)
 wxExcelRange: Returns a Range containing just one row with rowIndex (starting with 1).
wxExcelRange GetRows (const wxString &rowRange)
 wxExcelWorksheet: Returns a Range that can contain several contiguous rows.
wxExcelRange GetColumns ()
 wxExcelWorksheet: Returns a Range representing all the columns on the active worksheet.
wxExcelRange GetColumns (long columnIndex)
 wxExcelRange: Returns a Range containing just one column with columnIndex (starting with 1).
wxExcelRange GetColumns (const wxString &columnRange)
 wxExcelWorksheet: Returns a Range that can contain several contiguous columns.
Public Member Functions inherited from wxAutoExcel::wxExcelObject
bool IsOk_ () const
 Returns true if the object has a valid dispatch.
wxString GetAutomationObjectName_ (bool stripUnderscores=false) const
 Returns object name as provided by IDispatch->GetTypeInfo()->GetDocumentation(MEMBERID_NIL, &name, NULL, NULL, NULL).
wxSharedPtr< wxAutomationObject > GetAutomationObject_ ()
 Returns the underlying wxAutomationObject.
 operator bool () const
 Returns true if the object has a valid dispatch and its last automation call (if any), i.e.
bool IsLastResultNull_ () const
 Returns true if MS Excel returned Null (or Empty) for the last property or method, e.g.
WXLCID GetAutomationLCID_ () const
 Returns the locale identifier used in automation calls.
bool SetAutomationLCID_ (WXLCID lcid)
 Sets the locale identifier to be used in automation calls.
bool GetPropertyAndMethodNames_ (wxArrayString &propertyNames, wxArrayString &methodNames, bool includeHidden=false)
 Returns lists of property and method names the automation interface exposes.
bool GetUnimplementedObject_ (const wxString &name, wxAutomationObject &object)
 Helper function for receiving an automation object not implemented in wxAutoExcel, see FAQ on how to use.

Additional Inherited Members

Static Public Member Functions inherited from wxAutoExcel::wxExcelObject
static unsigned GetErrorMode_ ()
 Sets the error mode to the combination of wxExcelObject::ErrorFlags.
static void SetErrorMode_ (unsigned mode)
 Sets the error mode as the combination of wxExcelObject::ErrorFlags.
static bool GetUnimplementedCollectionItem_ (wxAutomationObject &collection, const long index, wxAutomationObject &item, bool asProperty)
 Helper function for obtaining an item from MS Excel collection not implemented in wxAutoExcel, see FAQ on how to use.

Detailed Description

Represents Microsoft Excel Range, i.e.

a collection of cells.

Member Typedef Documentation

◆ iterator

The iterator over the items of the range, see begin().

Member Function Documentation

◆ Activate()

bool wxAutoExcel::wxExcelRange::Activate ( )

Activates a single cell, which must be inside the current selection.

To select a range of cells, use the Select method.

MSDN documentation for Range.Activate.

◆ AddComment()

wxExcelComment wxAutoExcel::wxExcelRange::AddComment ( const wxString & text = wxEmptyString)

Adds a comment to the range.

MSDN documentation for Range.AddComment.

◆ AddCommentThreaded()

wxExcelCommentThreaded wxAutoExcel::wxExcelRange::AddCommentThreaded ( const wxString & text)

Adds a threaded comment to the range.

Since Excel for Microsoft 365.

MSDN documentation for Range.AddCommentThreaded.

◆ AdvancedFilter()

bool wxAutoExcel::wxExcelRange::AdvancedFilter ( enum XlFilterAction action,
wxExcelRange * criteriaRange = NULL,
wxExcelRange * copyToRange = NULL,
wxXlTribool unique = wxDefaultXlTribool )

Filters or copies data from a list based on a criteria range.

If the initial selection is a single cell, that cell's current region is used.

MSDN documentation for Range.AdvancedFilter.

◆ AllocateChanges()

void wxAutoExcel::wxExcelRange::AllocateChanges ( )

Performs a writeback operation for all edited cells in a range based on an OLAP data source.

Since Excel 2010.

MSDN documentation for Range.AllocateChanges.

◆ ApplyNames()

void wxAutoExcel::wxExcelRange::ApplyNames ( wxArrayString * names = NULL,
wxXlTribool ignoreRelativeAbsolute = NULL,
wxXlTribool useRowColumnNames = wxDefaultXlTribool,
wxXlTribool omitColumn = wxDefaultXlTribool,
wxXlTribool omitRow = wxDefaultXlTribool,
XlApplyNamesOrder * order = NULL,
wxXlTribool appendLast = wxDefaultXlTribool )

Applies names to the cells in the specified range.

MSDN documentation for Range.ApplyNames.

◆ ApplyOutlineStyles()

void wxAutoExcel::wxExcelRange::ApplyOutlineStyles ( )

Applies outlining styles to the specified range.

MSDN documentation for Range.ApplyOutlineStyles.

◆ AutoComplete()

wxString wxAutoExcel::wxExcelRange::AutoComplete ( const wxString & str)

Returns an AutoComplete match from the list.

If there's no AutoComplete match or if more than one entry in the list matches the string to complete, this method returns an empty string.

MSDN documentation for Range.AutoComplete.

◆ AutoFill()

bool wxAutoExcel::wxExcelRange::AutoFill ( wxExcelRange destination,
XlAutoFillType * type = NULL )

Performs an autofill on the cells in the specified range.

MSDN documentation for Range.AutoFill.

◆ AutoFilter()

bool wxAutoExcel::wxExcelRange::AutoFilter ( long * field = NULL,
const wxString & criteria1 = wxEmptyString,
XlAutoFilterOperator * oper = NULL,
const wxString & criteria2 = wxEmptyString,
wxXlTribool visibleDropDown = wxDefaultXlTribool )

Filters a list using the AutoFilter.

MSDN documentation for Range.AutoFilter.

◆ AutoFit()

bool wxAutoExcel::wxExcelRange::AutoFit ( )

Changes the width of the columns in the range or the height of the rows in the range to achieve the best fit.

MSDN documentation for Range.AutoFit.

◆ AutoOutline()

void wxAutoExcel::wxExcelRange::AutoOutline ( )

Automatically creates an outline for the specified range.

If the range is a single cell, Microsoft Excel creates an outline for the entire sheet. The new outline replaces any existing outline.

MSDN documentation for Range.AutoOutline.

◆ BorderAround()

bool wxAutoExcel::wxExcelRange::BorderAround ( XlLineStyle * lineStyle = NULL,
XlBorderWeight * weight = NULL,
long * colorIndex = NULL,
const wxColour * color = NULL )

Adds a border to a range and sets the Color, LineStyle, and Weight properties for the new border.

MSDN documentation for Range.BorderAround.

◆ Calculate()

void wxAutoExcel::wxExcelRange::Calculate ( )

◆ CalculateRowMajorOrder()

void wxAutoExcel::wxExcelRange::CalculateRowMajorOrder ( )

Calculates the range the same way Excel 2000 and earlier did.

MSDN documentation for Range.CalculateRowMajorOrder.

◆ CheckSpelling()

void wxAutoExcel::wxExcelRange::CheckSpelling ( const wxString & customDictionary = wxEmptyString,
wxXlTribool ignoreUpperCase = wxDefaultXlTribool,
wxXlTribool alwaysSuggest = wxDefaultXlTribool,
MsoLanguageID * spellLang = NULL )

Checks the spelling of an object.

MSDN documentation for Range.CheckSpelling.

◆ Clear()

bool wxAutoExcel::wxExcelRange::Clear ( )

Clears the entire object.

MSDN documentation for Range.Clear.

◆ ClearComments()

bool wxAutoExcel::wxExcelRange::ClearComments ( )

Clears all cell comments from the specified range.

MSDN documentation for Range.ClearComments.

◆ ClearContents()

bool wxAutoExcel::wxExcelRange::ClearContents ( )

Clears the formulas from the range.

MSDN documentation for Range.ClearContents.

◆ ClearFormats()

bool wxAutoExcel::wxExcelRange::ClearFormats ( )

Clears the formatting of the object.

MSDN documentation for Range.ClearFormats.

◆ ClearHyperlinks()

bool wxAutoExcel::wxExcelRange::ClearHyperlinks ( )

Removes all hyperlinks from the specified range.

Since Excel 2010.

MSDN documentation for Range.ClearHyperlinks.

◆ ClearNotes()

bool wxAutoExcel::wxExcelRange::ClearNotes ( )

Clears notes and sound notes from all the cells in the specified range.

MSDN documentation for Range.ClearNotes.

◆ ClearOutline()

bool wxAutoExcel::wxExcelRange::ClearOutline ( )

Clears the outline for the specified range.

MSDN documentation for Range.ClearOutline.

◆ ColumnDifferences()

wxExcelRange wxAutoExcel::wxExcelRange::ColumnDifferences ( wxExcelRange comparison)

Returns a Range Represents all the cells whose contents are different from the comparison cell in each column.

MSDN documentation for Range.ColumnDifferences.

◆ Copy()

bool wxAutoExcel::wxExcelRange::Copy ( const wxExcelRange * destination = NULL)

Copies the range to the specified range or to the Clipboard.

MSDN documentation for Range.Copy.

◆ CopyPicture()

bool wxAutoExcel::wxExcelRange::CopyPicture ( XlPictureAppearance * appearance = NULL,
XlCopyPictureFormat * format = NULL )

Copies the selected object to the Clipboard as a picture.

MSDN documentation for Range.CopyPicture.

◆ CreateNames()

bool wxAutoExcel::wxExcelRange::CreateNames ( wxXlTribool top = wxDefaultXlTribool,
wxXlTribool left = wxDefaultXlTribool,
wxXlTribool bottom = wxDefaultXlTribool,
wxXlTribool right = wxDefaultXlTribool )

Creates names in the specified range, based on text labels in the sheet.

MSDN documentation for Range.CreateNames.

◆ Cut()

bool wxAutoExcel::wxExcelRange::Cut ( const wxExcelRange * destination = NULL)

Cuts the object to the Clipboard or pastes it into a specified destination.

MSDN documentation for Range.Cut.

◆ DataSeries()

bool wxAutoExcel::wxExcelRange::DataSeries ( XlRowCol * rowCol = NULL,
XlDataSeriesType * type = NULL,
XlDataSeriesDate * date = NULL,
long * step = NULL,
const wxVariant & stop = wxNullVariant,
wxXlTribool trend = wxDefaultXlTribool )

Creates a data series in the specified range.

MSDN documentation for Range.DataSeries.

◆ Delete()

bool wxAutoExcel::wxExcelRange::Delete ( XlDeleteShiftDirection * shift = NULL)

◆ Dirty()

void wxAutoExcel::wxExcelRange::Dirty ( )

Designates a range to be recalculated when the next recalculation occurs.

MSDN documentation for Range.Dirty.

◆ DiscardChanges()

void wxAutoExcel::wxExcelRange::DiscardChanges ( )

Discards all changes in the edited cells of the range.

Since Excel 2010.

MSDN documentation for Range.DiscardChanges.

◆ ExportAsFixedFormat()

void wxAutoExcel::wxExcelRange::ExportAsFixedFormat ( XlFixedFormatType type,
const wxString & fileName = wxEmptyString,
XlFixedFormatQuality * quality = NULL,
wxXlTribool includeDocProperties = wxDefaultXlTribool,
wxXlTribool ignorePrintAreas = wxDefaultXlTribool,
long * from = NULL,
long * to = NULL,
wxXlTribool openAfterPublish = wxDefaultXlTribool )

Exports to an XPS or PDF file.

MSDN documentation for Range.ExportAsFixedFormat.

◆ FillDown()

bool wxAutoExcel::wxExcelRange::FillDown ( )

Fills down from the top cell or cells in the specified range to the bottom of the range.

The contents and formatting of the cell or cells in the top row of a range are copied into the rest of the rows in the range.

MSDN documentation for Range.FillDown.

◆ FillLeft()

bool wxAutoExcel::wxExcelRange::FillLeft ( )

Fills left from the rightmost cell or cells in the specified range.

The contents and formatting of the cell or cells in the rightmost column of a range are copied into the rest of the columns in the range.

MSDN documentation for Range.FillLeft.

◆ FillRight()

bool wxAutoExcel::wxExcelRange::FillRight ( )

Fills right from the leftmost cell or cells in the specified range.

The contents and formatting of the cell or cells in the leftmost column of a range are copied into the rest of the columns in the range.

MSDN documentation for Range.FillRight.

◆ FillUp()

bool wxAutoExcel::wxExcelRange::FillUp ( )

Fills up from the bottom cell or cells in the specified range to the top of the range.

The contents and formatting of the cell or cells in the bottom row of a range are copied into the rest of the rows in the range.

MSDN documentation for Range.FillUp.

◆ Find()

wxExcelRange wxAutoExcel::wxExcelRange::Find ( const wxVariant & what,
wxExcelRange * after = NULL,
XlFindLookIn * lookIn = NULL,
XlLookAt * lookAt = NULL,
XlSearchOrder * searchOrder = NULL,
XlSearchDirection * searchDirection = NULL,
wxXlTribool matchCase = wxDefaultXlTribool,
wxXlTribool matchByte = wxDefaultXlTribool,
wxXlTribool searchFormat = wxDefaultXlTribool )

Finds specific information in a range, returns the first cell where the information is found, or an invalid range (see wxExcelObject::IsOk_()) when no match is found, which is not an error.

Only the arguments which are set are passed to Excel. The settings for lookIn, lookAt, searchOrder, and matchByte are saved each time this method is used, so they are used by the next call when they are not set, and they also change the settings in the Find dialog box of Excel.

The search starts after the after cell, which must be a single cell in the range, by default after the cell in the upper-left corner of the range, so that cell is searched last. See FindAll_() for obtaining all the matching cells.

When the range is a single cell, Excel searches the whole worksheet, as in its user interface.

MSDN documentation for Range.Find.

◆ FindNext()

wxExcelRange wxAutoExcel::wxExcelRange::FindNext ( wxExcelRange * after = NULL)

Continues a search that was begun with Find(), returns the next cell matching the same conditions, which may be the first one found when the search wraps around the range, or an invalid range when no match is found.

The search starts after the after cell, by default after the active cell, so the cell found last should usually be passed.

MSDN documentation for Range.FindNext.

◆ FindPrevious()

wxExcelRange wxAutoExcel::wxExcelRange::FindPrevious ( wxExcelRange * after = NULL)

Continues a search that was begun with Find(), returns the previous cell matching the same conditions, or an invalid range when no match is found.

The search starts before the after cell, by default before the active cell, so the cell found last should usually be passed.

MSDN documentation for Range.FindPrevious.

◆ FlashFill()

void wxAutoExcel::wxExcelRange::FlashFill ( )

Flash Fill automatically fills the data when it senses a pattern.

Excel VBA documentation for Range.FlashFill

◆ FunctionWizard()

void wxAutoExcel::wxExcelRange::FunctionWizard ( )

Starts the Function Wizard for the upper-left cell of the range.

MSDN documentation for Range.FunctionWizard.

◆ Group()

bool wxAutoExcel::wxExcelRange::Group ( )

Demotes a range in an outline (that is, increases its outline level).

The specified range must be a row or column, or a range of rows or columns. The optional arguments for grouping the items in a PivotTable report are not supported.

MSDN documentation for Range.Group.

◆ Insert()

bool wxAutoExcel::wxExcelRange::Insert ( XlInsertShiftDirection * shift)

Inserts a cell or a range of cells into the worksheet or macro sheet and shifts other cells away to make space.

MSDN documentation for Range.Insert.

◆ InsertIndent()

void wxAutoExcel::wxExcelRange::InsertIndent ( long insertAmount)

Adds an indent to the specified range.

MSDN documentation for Range.InsertIndent.

◆ Justify()

bool wxAutoExcel::wxExcelRange::Justify ( )

Rearranges the text in a range so that it fills the range evenly.

MSDN documentation for Range.Justify.

◆ ListNames()

bool wxAutoExcel::wxExcelRange::ListNames ( )

Pastes a list of all nonhidden names onto the worksheet, beginning with the first cell in the range.

MSDN documentation for Range.ListNames.

◆ Merge()

void wxAutoExcel::wxExcelRange::Merge ( wxXlTribool across = wxDefaultXlTribool)

Creates a merged cell from the specified Range object.

MSDN documentation for Range.Merge.

◆ NavigateArrow()

bool wxAutoExcel::wxExcelRange::NavigateArrow ( wxXlTribool towardPrecedent = wxDefaultXlTribool,
long * arrowNumber = NULL,
long * linkNumber = NULL )

Navigates a tracer arrow for the specified range to the precedent, dependent, or error-causing cell or cells.

Selects the precedent, dependent, or error cells and returns a Range Represents the new selection. This method causes an error if it's applied to a cell without visible tracer arrows.

MSDN documentation for Range.NavigateArrow.

◆ PasteSpecial()

bool wxAutoExcel::wxExcelRange::PasteSpecial ( XlPasteType * paste = NULL,
XlPasteSpecialOperation * operation = NULL,
wxXlTribool skipBlanks = wxDefaultXlTribool,
wxXlTribool transpose = wxDefaultXlTribool )

Pastes a Range from the Clipboard into the specified range.

MSDN documentation for Range.PasteSpecial.

◆ PrintOut()

bool wxAutoExcel::wxExcelRange::PrintOut ( long * from = NULL,
long * to = NULL,
long * copies = NULL,
wxXlTribool preview = wxDefaultXlTribool,
const wxString & activePrinter = wxEmptyString,
wxXlTribool printToFile = wxDefaultXlTribool,
wxXlTribool collate = wxDefaultXlTribool,
const wxString & prToFileName = wxEmptyString )

◆ PrintPreview()

bool wxAutoExcel::wxExcelRange::PrintPreview ( wxXlTribool enableChanges = wxDefaultXlTribool)

Shows a preview of the object as it would look when printed.

MSDN documentation for Range.PrintPreview.

◆ RemoveDuplicates()

void wxAutoExcel::wxExcelRange::RemoveDuplicates ( const wxArrayLong & columns,
XlYesNoGuess * header = NULL )

Removes duplicate values from a range of values.

MSDN documentation for Range.RemoveDuplicates.

◆ RemoveSubtotal()

void wxAutoExcel::wxExcelRange::RemoveSubtotal ( )

Removes subtotals from a list.

MSDN documentation for Range.RemoveSubtotal.

◆ Replace()

bool wxAutoExcel::wxExcelRange::Replace ( const wxVariant & what,
const wxVariant & replacement,
XlLookAt * lookAt = NULL,
XlSearchOrder * searchOrder = NULL,
wxXlTribool matchCase = wxDefaultXlTribool,
wxXlTribool matchByte = wxDefaultXlTribool,
wxXlTribool searchFormat = wxDefaultXlTribool,
wxXlTribool replaceFormat = wxDefaultXlTribool )

Replaces what with replacement in the cells of the range.

Returns true if the call succeeded, regardless of whether anything was replaced.

Only the arguments which are set are passed to Excel. The settings for lookAt, searchOrder, matchCase, and matchByte are saved each time this method is used, so they are used by the next call to this method or Find() when they are not set.

When the range is a single cell, Excel replaces in the whole worksheet, as in its user interface.

MSDN documentation for Range.Replace.

◆ RowDifferences()

wxExcelRange wxAutoExcel::wxExcelRange::RowDifferences ( wxExcelRange comparison)

Returns a Range Represents all the cells whose contents are different from those of the comparison cell in each row.

MSDN documentation for Range.RowDifferences.

◆ Select()

bool wxAutoExcel::wxExcelRange::Select ( )

◆ Show()

bool wxAutoExcel::wxExcelRange::Show ( )

Scrolls through the contents of the active window to move the range into view.

The range must consist of a single cell in the active document.

MSDN documentation for Range.Show.

◆ ShowDependents()

bool wxAutoExcel::wxExcelRange::ShowDependents ( wxXlTribool remove = wxDefaultXlTribool)

Draws tracer arrows to the direct dependents of the range.

MSDN documentation for Range.ShowDependents.

◆ ShowErrors()

wxExcelRange wxAutoExcel::wxExcelRange::ShowErrors ( )

Draws tracer arrows through the precedents tree to the cell that's the source of the error, and returns the range that contains that cell.

MSDN documentation for Range.ShowErrors.

◆ ShowPrecedents()

bool wxAutoExcel::wxExcelRange::ShowPrecedents ( wxXlTribool remove = wxDefaultXlTribool)

Draws tracer arrows to the direct precedents of the range.

MSDN documentation for Range.ShowPrecedents.

◆ SpecialCells()

wxExcelRange wxAutoExcel::wxExcelRange::SpecialCells ( XlCellType type,
const wxVariant & value = wxNullVariant )

Returns a Range Represents all the cells that match the specified type and value.

MSDN documentation for Range.SpecialCells.

◆ Subtotal()

bool wxAutoExcel::wxExcelRange::Subtotal ( XlConsolidationFunction groupBy,
XlConsolidationFunction function,
wxArrayLong & totalList,
wxXlTribool replace = wxDefaultXlTribool,
wxXlTribool pageBreaks = wxDefaultXlTribool,
XlSummaryRow * summaryBelowData = NULL )

Creates subtotals for the range (or the current region, if the range is a single cell).

MSDN documentation for Range.Subtotal.

◆ Table()

void wxAutoExcel::wxExcelRange::Table ( wxExcelRange * rowInput = NULL,
wxExcelRange * columnInput = NULL )

Creates a data table based on input values and formulas that you define on a worksheet.

MSDN documentation for Range.Table.

◆ Ungroup()

bool wxAutoExcel::wxExcelRange::Ungroup ( )

Promotes a range in an outline (that is, decreases its outline level).

The specified range must be a row or column, or a range of rows or columns. If the range is in a PivotTable report, this method ungroups the items contained in the range.

MSDN documentation for Range.Ungroup.

◆ UnMerge()

void wxAutoExcel::wxExcelRange::UnMerge ( )

Separates a merged area into individual cells.

MSDN documentation for Range.UnMerge.

◆ GetAddIndent()

bool wxAutoExcel::wxExcelRange::GetAddIndent ( )

True if text is automatically indented when the text alignment in a cell is set to equal distribution (either horizontally or vertically.); MSDN documentation for Range.AddIndent.

◆ SetAddIndent()

void wxAutoExcel::wxExcelRange::SetAddIndent ( bool addIndent)

True if text is automatically indented when the text alignment in a cell is set to equal distribution (either horizontally or vertically.); MSDN documentation for Range.AddIndent.

◆ GetAddress()

wxString wxAutoExcel::wxExcelRange::GetAddress ( wxXlTribool rowAbsolute = wxDefaultXlTribool,
wxXlTribool columnAbsolute = wxDefaultXlTribool,
XlReferenceStyle * referenceStyle = NULL,
wxXlTribool external = wxDefaultXlTribool,
wxExcelRange * relativeTo = NULL )

Returns a value that represents the range reference in the language of the macro.

For a range with several areas, the separator of the areas is either a comma or the list separator of the Windows regional settings, depending on how the range was obtained. Use GetAddressLocal() to get an address which can be passed to GetRange().

MSDN documentation for Range.Address.

◆ GetAddressLocal()

wxString wxAutoExcel::wxExcelRange::GetAddressLocal ( wxXlTribool rowAbsolute = wxDefaultXlTribool,
wxXlTribool columnAbsolute = wxDefaultXlTribool,
XlReferenceStyle * referenceStyle = NULL,
wxXlTribool external = wxDefaultXlTribool,
wxExcelRange * relativeTo = NULL )

Returns the range reference for the specified range in the language of the user.

For a range with several areas, the areas are separated with the list separator of the Windows regional settings, which GetRange() expects, see wxExcelApplication::GetListSeparator_().

MSDN documentation for Range.AddressLocal.

◆ GetAllowEdit()

bool wxAutoExcel::wxExcelRange::GetAllowEdit ( )

True if the range can be edited on a protected worksheet.

MSDN documentation for Range.AllowEdit.

◆ GetAreas()

wxExcelAreas wxAutoExcel::wxExcelRange::GetAreas ( )

Returns an Areas collection that represents all the ranges in a multiple-area selection.

MSDN documentation for Range.Areas.

◆ GetBorders()

wxExcelBorders wxAutoExcel::wxExcelRange::GetBorders ( )

Returns a Borders collection that represents the borders of a style or a range of cells (including a range defined as part of a conditional format).

MSDN documentation for Range.Borders.

◆ GetCharacters()

wxExcelCharacters wxAutoExcel::wxExcelRange::GetCharacters ( long start = 1,
long * length = NULL )

Returns a Characters Represents a range of characters within the object text.

You can use the Characters object to format characters within a text string.

MSDN documentation for Range.Characters.

◆ GetColumn()

long wxAutoExcel::wxExcelRange::GetColumn ( )

Returns the number of the first column in the first area in the specified range.

MSDN documentation for Range.Column.

◆ GetColumnWidth()

double wxAutoExcel::wxExcelRange::GetColumnWidth ( )

If all columns in the range have same width returns the width in points else returns -1.

Returns -2 on error.

MSDN documentation for Range.ColumnWidth.

◆ SetColumnWidth()

void wxAutoExcel::wxExcelRange::SetColumnWidth ( double colWidth)

Sets the column width for all the columns in the range.

MSDN documentation for Range.ColumnWidth.

◆ GetComment()

wxExcelComment wxAutoExcel::wxExcelRange::GetComment ( )

Returns a comment associated with the cell in the upper-left corner of the range.

MSDN documentation for Range.Comment.

◆ GetCommentThreaded()

wxExcelCommentThreaded wxAutoExcel::wxExcelRange::GetCommentThreaded ( )

Returns a CommentThreaded object that represents the threaded comment associated with the cell in the upper-left corner of the range.

MSDN documentation for Range.CommentThreaded.

◆ GetCount()

long wxAutoExcel::wxExcelRange::GetCount ( )

Returns a value that represents the number of cells in the range.

MSDN documentation for Range.Count.

◆ GetCountLarge()

wxLongLong wxAutoExcel::wxExcelRange::GetCountLarge ( )

Returns a value that represents the number of cells in the range.

Since Excel 2007.

MSDN documentation for Range.CountLarge.

◆ GetCurrentArray()

wxExcelRange wxAutoExcel::wxExcelRange::GetCurrentArray ( )

If the specified cell is part of an array, returns a Range Represents the entire array.

MSDN documentation for Range.CurrentArray.

◆ GetCurrentRegion()

wxExcelRange wxAutoExcel::wxExcelRange::GetCurrentRegion ( )

Returns a Range Represents the current region.

The current region is a range bounded by any combination of blank rows and blank columns.

MSDN documentation for Range.CurrentRegion.

◆ GetDependents()

wxExcelRange wxAutoExcel::wxExcelRange::GetDependents ( )

Returns a Range Represents the range containing all the dependents of a cell.

This can be a multiple selection (a union of Range objects) if there's more than one dependent.

MSDN documentation for Range.Dependents.

◆ GetDirectDependents()

wxExcelRange wxAutoExcel::wxExcelRange::GetDirectDependents ( )

Returns a Range Represents the range containing all the direct dependents of a cell.

This can be a multiple selection (a union of Range objects) if there's more than one dependent.

MSDN documentation for Range.DirectDependents.

◆ GetDirectPrecedents()

wxExcelRange wxAutoExcel::wxExcelRange::GetDirectPrecedents ( )

Returns a Range Represents the range containing all the direct precedents of a cell.

This can be a multiple selection (a union of Range objects) if there's more than one precedent.

MSDN documentation for Range.DirectPrecedents.

◆ GetDisplayFormat()

wxExcelDisplayFormat wxAutoExcel::wxExcelRange::GetDisplayFormat ( )

Returns a DisplayFormat object that represents the display settings for the range, including the formatting applied by conditional formatting.

Since Excel 2010.

MSDN documentation for Range.DisplayFormat.

◆ GetEnd()

wxExcelRange wxAutoExcel::wxExcelRange::GetEnd ( XlDirection direction)

Returns a Range Represents the cell at the end of the region that contains the source range.

Equivalent to pressing END+UP ARROW, END+DOWN ARROW, END+LEFT ARROW, or END+RIGHT ARROW.

MSDN documentation for Range.End.

◆ GetEntireColumn()

wxExcelRange wxAutoExcel::wxExcelRange::GetEntireColumn ( )

Returns a Range Represents the entire column (or columns) that contains the specified range.

MSDN documentation for Range.EntireColumn.

◆ GetEntireRow()

wxExcelRange wxAutoExcel::wxExcelRange::GetEntireRow ( )

Returns a Range Represents the entire row (or rows) that contains the specified range.

MSDN documentation for Range.EntireRow.

◆ GetErrors()

wxExcelErrors wxAutoExcel::wxExcelRange::GetErrors ( )

Allows the user to to access error checking options.

MSDN documentation for Range.Errors.

◆ GetFont()

wxExcelFont wxAutoExcel::wxExcelRange::GetFont ( )

Returns a Font Represents the font of the specified object.

MSDN documentation for Range.Font.

◆ GetFormatConditions()

wxExcelFormatConditions wxAutoExcel::wxExcelRange::GetFormatConditions ( )

Returns a FormatConditions collection that represents all the conditional formats for the specified range.

MSDN documentation for Range.FormatConditions.

◆ GetFormula() [1/2]

wxString wxAutoExcel::wxExcelRange::GetFormula ( )

Returns the formula of a single cell, in A1-style notation and in the language of the macro.

For a range with more than one cell, Excel returns the formulas of all its cells, which this method cannot return, so it fails; use GetFormula(wxVariant&) instead.

MSDN documentation for Range.Formula.

◆ GetFormula() [2/2]

bool wxAutoExcel::wxExcelRange::GetFormula ( wxVariant & formulas)

Returns the formulas of all cells in the range, in A1-style notation and in the language of the macro.

For a single cell, formulas contains a string. For more cells, it contains the formulas in the same way GetValue() returns the values, i.e. a list of strings ordered by columns, or a two-dimensional SAFEARRAY when wxOleConvertVariant_ReturnSafeArrays is set with SetConvertVariantFlags_(). Cells without a formula have their constant value as a string, empty cells an empty string.

Returns true if the formulas were obtained.

MSDN documentation for Range.Formula.

◆ SetFormula()

void wxAutoExcel::wxExcelRange::SetFormula ( const wxVariant & formula)

Sets the formula of all cells in the range, in A1-style notation and in the language of the macro.

A string sets the same formula for all cells, with its relative references adjusted for each cell. To set a different formula for each cell, pass an array with the same dimensions as the range, e.g. a two-dimensional SAFEARRAY created with wxSafeArray, see the bulkdata sample; a list of strings can be used for a range with a single row. A null wxVariant clears the cells.

MSDN documentation for Range.Formula.

◆ GetFormulaArray()

wxString wxAutoExcel::wxExcelRange::GetFormulaArray ( )

Returns the array formula of a range.

Returns (or can be set to) a single formula or a Visual Basic array. If the specified range doesn't contain an array formula, this property returns null.

MSDN documentation for Range.FormulaArray.

◆ SetFormulaArray()

void wxAutoExcel::wxExcelRange::SetFormulaArray ( const wxString & formula)

Sets the array formula of a range.

MSDN documentation for Range.FormulaArray.

◆ GetFormulaHidden()

wxXlTribool wxAutoExcel::wxExcelRange::GetFormulaHidden ( )

Whether the formula will be hidden when the worksheet is protected.

Returns tb_true if all cells in the range have this property set to true, tb_false if all cells in the range have this property set to false, and tb_default if the value of this property is not same for all cells in the range.

MSDN documentation for Range.FormulaHidden.

◆ SetFormulaHidden()

void wxAutoExcel::wxExcelRange::SetFormulaHidden ( const bool hidden)

True if the formula will be hidden when the worksheet is protected.

MSDN documentation for Range.FormulaHidden.

◆ GetFormulaLocal() [1/2]

wxString wxAutoExcel::wxExcelRange::GetFormulaLocal ( )

Returns the formula of a single cell, using A1-style references in the language of the user.

For a range with more than one cell, Excel returns the formulas of all its cells, which this method cannot return, so it fails; use GetFormulaLocal(wxVariant&) instead.

MSDN documentation for Range.FormulaLocal.

◆ GetFormulaLocal() [2/2]

bool wxAutoExcel::wxExcelRange::GetFormulaLocal ( wxVariant & formulas)

Returns the formulas of all cells in the range, using A1-style references in the language of the user.

For a single cell, formulas contains a string. For more cells, it contains the formulas in the same way GetValue() returns the values, i.e. a list of strings ordered by columns, or a two-dimensional SAFEARRAY when wxOleConvertVariant_ReturnSafeArrays is set with SetConvertVariantFlags_(). Cells without a formula have their constant value as a string, empty cells an empty string.

Returns true if the formulas were obtained.

MSDN documentation for Range.FormulaLocal.

◆ SetFormulaLocal()

void wxAutoExcel::wxExcelRange::SetFormulaLocal ( const wxVariant & formulaLocal)

Sets the formula of all cells in the range, using A1-style references in the language of the user.

A string sets the same formula for all cells, with its relative references adjusted for each cell. To set a different formula for each cell, pass an array with the same dimensions as the range, e.g. a two-dimensional SAFEARRAY created with wxSafeArray, see the bulkdata sample; a list of strings can be used for a range with a single row. A null wxVariant clears the cells.

MSDN documentation for Range.FormulaLocal.

◆ GetFormulaR1C1() [1/2]

wxString wxAutoExcel::wxExcelRange::GetFormulaR1C1 ( )

Returns the formula of a single cell, using R1C1-style notation in the language of the macro.

For a range with more than one cell, Excel returns the formulas of all its cells, which this method cannot return, so it fails; use GetFormulaR1C1(wxVariant&) instead.

MSDN documentation for Range.FormulaR1C1.

◆ GetFormulaR1C1() [2/2]

bool wxAutoExcel::wxExcelRange::GetFormulaR1C1 ( wxVariant & formulas)

Returns the formulas of all cells in the range, using R1C1-style notation in the language of the macro.

For a single cell, formulas contains a string. For more cells, it contains the formulas in the same way GetValue() returns the values, i.e. a list of strings ordered by columns, or a two-dimensional SAFEARRAY when wxOleConvertVariant_ReturnSafeArrays is set with SetConvertVariantFlags_(). Cells without a formula have their constant value as a string, empty cells an empty string.

Returns true if the formulas were obtained.

MSDN documentation for Range.FormulaR1C1.

◆ SetFormulaR1C1()

void wxAutoExcel::wxExcelRange::SetFormulaR1C1 ( const wxVariant & formulaR1C1)

Sets the formula of all cells in the range, using R1C1-style notation in the language of the macro.

A string sets the same formula for all cells, with its relative references adjusted for each cell. To set a different formula for each cell, pass an array with the same dimensions as the range, e.g. a two-dimensional SAFEARRAY created with wxSafeArray, see the bulkdata sample; a list of strings can be used for a range with a single row. A null wxVariant clears the cells.

MSDN documentation for Range.FormulaR1C1.

◆ GetFormulaR1C1Local() [1/2]

wxString wxAutoExcel::wxExcelRange::GetFormulaR1C1Local ( )

Returns the formula of a single cell, using R1C1-style notation in the language of the user.

For a range with more than one cell, Excel returns the formulas of all its cells, which this method cannot return, so it fails; use GetFormulaR1C1Local(wxVariant&) instead.

MSDN documentation for Range.FormulaR1C1Local.

◆ GetFormulaR1C1Local() [2/2]

bool wxAutoExcel::wxExcelRange::GetFormulaR1C1Local ( wxVariant & formulas)

Returns the formulas of all cells in the range, using R1C1-style notation in the language of the user.

For a single cell, formulas contains a string. For more cells, it contains the formulas in the same way GetValue() returns the values, i.e. a list of strings ordered by columns, or a two-dimensional SAFEARRAY when wxOleConvertVariant_ReturnSafeArrays is set with SetConvertVariantFlags_(). Cells without a formula have their constant value as a string, empty cells an empty string.

Returns true if the formulas were obtained.

MSDN documentation for Range.FormulaR1C1Local.

◆ SetFormulaR1C1Local()

void wxAutoExcel::wxExcelRange::SetFormulaR1C1Local ( const wxVariant & formulaR1C1Local)

Sets the formula of all cells in the range, using R1C1-style notation in the language of the user.

A string sets the same formula for all cells, with its relative references adjusted for each cell. To set a different formula for each cell, pass an array with the same dimensions as the range, e.g. a two-dimensional SAFEARRAY created with wxSafeArray, see the bulkdata sample; a list of strings can be used for a range with a single row. A null wxVariant clears the cells.

MSDN documentation for Range.FormulaR1C1Local.

◆ GetHasArray()

wxXlTribool wxAutoExcel::wxExcelRange::GetHasArray ( )

True if the specified cell is part of an array formula.

MSDN documentation for Range.HasArray.

◆ GetHasFormula()

wxXlTribool wxAutoExcel::wxExcelRange::GetHasFormula ( )

Returns tb_true if all cells in the range contain formulas, tb_false if none of the cells in the range contains a formula, and tb_default otherwise.

MSDN documentation for Range.HasFormula.

◆ GetHeight()

double wxAutoExcel::wxExcelRange::GetHeight ( )

The range height in points.

MSDN documentation for Range.Height.

◆ GetHidden()

bool wxAutoExcel::wxExcelRange::GetHidden ( )

If true the rows or columns are hidden.

The range must span entire row or column.

MSDN documentation for Range.Hidden.

◆ SetHidden()

void wxAutoExcel::wxExcelRange::SetHidden ( bool hidden)

If true the rows or columns are hidden.

The range must span entire row or column.

MSDN documentation for Range.Hidden.

◆ GetHorizontalAlignment()

long wxAutoExcel::wxExcelRange::GetHorizontalAlignment ( )

Horizontal alignment for the range.

MSDN documentation for Range.HorizontalAlignment.

◆ SetHorizontalAlignment()

void wxAutoExcel::wxExcelRange::SetHorizontalAlignment ( const long alignment)

Horizontal alignment for the range.

MSDN documentation for Range.HorizontalAlignment.

◆ GetHyperlinks()

wxExcelHyperlinks wxAutoExcel::wxExcelRange::GetHyperlinks ( )

Returns a Hyperlinks collection that represents the hyperlinks for the range.

MSDN documentation for Range.Hyperlinks.

◆ GetID()

wxString wxAutoExcel::wxExcelRange::GetID ( )

The identifying label for the specified cell when the page is saved as a Web page.

MSDN documentation for Range.ID.

◆ SetID()

void wxAutoExcel::wxExcelRange::SetID ( const wxString & ID)

The identifying label for the specified cell when the page is saved as a Web page.

MSDN documentation for Range.ID.

◆ GetIndentLevel()

long wxAutoExcel::wxExcelRange::GetIndentLevel ( )

The indent level for the range.

Can be an integer from 0 to 15.

MSDN documentation for Range.IndentLevel.

◆ SetIndentLevel()

void wxAutoExcel::wxExcelRange::SetIndentLevel ( long indentLevel)

The indent level for the range.

Can be an integer from 0 to 15.

MSDN documentation for Range.IndentLevel.

◆ GetInterior()

wxExcelInterior wxAutoExcel::wxExcelRange::GetInterior ( )

Returns an Interior Represents the interior of the range.

MSDN documentation for Range.Interior.

◆ GetItem()

wxExcelRange wxAutoExcel::wxExcelRange::GetItem ( long rowIndex,
long * columnIndex = NULL )

Returns a Range Represents a range at an offset to the specified range.

MSDN documentation for Range.Item.

◆ operator[]()

wxExcelRange wxAutoExcel::wxExcelRange::operator[] ( long index)

Returns the item of the range at index, starting from 1, as Item with a single argument does in VBA: a cell, counting across the rows, for a range of cells, a row for a range returned by GetRows(), or a column for a range returned by GetColumns().

A row or column returned this way is a range of rows or columns, i.e. a range with a single item, see GetCells() for its cells.

For a range with several areas, the index is relative to the first area, see GetAreas().

MSDN documentation for Range.Item.

◆ GetLeft()

double wxAutoExcel::wxExcelRange::GetLeft ( )

Returns the distance, in points, from the left edge of column A to the left edge of the range.

MSDN documentation for Range.Left.

◆ GetListHeaderRows()

long wxAutoExcel::wxExcelRange::GetListHeaderRows ( )

Returns the number of header rows for the specified range.

MSDN documentation for Range.ListHeaderRows.

◆ GetListObject()

wxExcelListObject wxAutoExcel::wxExcelRange::GetListObject ( )

Returns a ListObject for Range.

MSDN documentation for Range.ListObject.

◆ GetLocationInTable()

XlLocationInTable wxAutoExcel::wxExcelRange::GetLocationInTable ( )

Returns a constant that describes the part of the PivotTable report that contains the upper-left corner of the specified range.

Can be one of the following XlLocationInTable. constants.

MSDN documentation for Range.LocationInTable.

◆ GetLocked()

wxXlTribool wxAutoExcel::wxExcelRange::GetLocked ( )

Returns tb_true if all cells in the range are locked, tb_true if all cells in the range are unlocked, and tb_default is some cells are locked and some are not.

MSDN documentation for Range.Locked.

◆ SetLocked()

void wxAutoExcel::wxExcelRange::SetLocked ( bool locked)

Sets a value that indicates if the object is locked.

MSDN documentation for Range.Locked.

◆ GetMDX()

wxString wxAutoExcel::wxExcelRange::GetMDX ( )

Returns the MDX name for the specified Range object.

Since Excel 2007.

MSDN documentation for Range.MDX.

◆ GetMergeArea()

wxExcelRange wxAutoExcel::wxExcelRange::GetMergeArea ( )

Returns a Range Represents the merged range containing the specified cell.

If the specified cell isn't in a merged range, this property returns the specified cell.

MSDN documentation for Range.MergeArea.

◆ GetMergeCells()

bool wxAutoExcel::wxExcelRange::GetMergeCells ( )

True if the range contains merged cells.

MSDN documentation for Range.MergeCells.

◆ SetMergeCells()

void wxAutoExcel::wxExcelRange::SetMergeCells ( bool mergeCells)

Merges the cells of each area of the range when true, unmerges them when false.

MSDN documentation for Range.MergeCells.

◆ GetName()

wxExcelName wxAutoExcel::wxExcelRange::GetName ( )

Returns the name of the object.

MSDN documentation for Range.Name.

◆ SetName()

void wxAutoExcel::wxExcelRange::SetName ( const wxString & name)

Sets the name of the object.

MSDN documentation for Range.Name.

◆ GetNext()

wxExcelRange wxAutoExcel::wxExcelRange::GetNext ( )

Returns a range representing the next cell.

MSDN documentation for Range.Next.

◆ GetNumberformat()

wxString wxAutoExcel::wxExcelRange::GetNumberformat ( )

Returns the format code for the range or an empty string if all the cells in range don't share the same format.

The name is spelled Numberformat rather than NumberFormat as in Excel, because the Windows headers define GetNumberFormat as a macro, which would otherwise rename the method.

MSDN documentation for Range.NumberFormat.

◆ SetNumberformat()

void wxAutoExcel::wxExcelRange::SetNumberformat ( const wxString & numberFormat)

Sets the format code for the range.

The name is spelled Numberformat rather than NumberFormat as in Excel, because the Windows headers define GetNumberFormat as a macro, which would otherwise rename the method.

MSDN documentation for Range.NumberFormat.

◆ GetNumberformatLocal()

wxString wxAutoExcel::wxExcelRange::GetNumberformatLocal ( )

Returns the format code for the range as a string in the language of the user or an empty string if all the cells in range don't share the same format.

The name is spelled Numberformat rather than NumberFormat as in Excel, because the Windows headers define GetNumberFormat as a macro, which would otherwise rename the method.

MSDN documentation for Range.NumberFormatLocal.

◆ SetNumberformatLocal()

void wxAutoExcel::wxExcelRange::SetNumberformatLocal ( const wxString & numberFormatLocal)

Sets the format code for the range as a string in the language of the user.

The name is spelled Numberformat rather than NumberFormat as in Excel, because the Windows headers define GetNumberFormat as a macro, which would otherwise rename the method.

MSDN documentation for Range.NumberFormatLocal.

◆ GetOffset()

wxExcelRange wxAutoExcel::wxExcelRange::GetOffset ( long rowOffset = 0,
long columnOffset = 0 )

Returns a Range Represents a range that's offset from the specified range.

MSDN documentation for Range.Offset.

◆ GetOrientation()

long wxAutoExcel::wxExcelRange::GetOrientation ( )

Returns the text orientation.

See XlOrientation

MSDN documentation for Range.Orientation.

◆ SetOrientation()

void wxAutoExcel::wxExcelRange::SetOrientation ( long orientation)

◆ GetOutlineLevel()

long wxAutoExcel::wxExcelRange::GetOutlineLevel ( )

Returns the current outline level of the specified row or column.

MSDN documentation for Range.OutlineLevel.

◆ SetOutlineLevel()

void wxAutoExcel::wxExcelRange::SetOutlineLevel ( long outlineLevel)

Sets the current outline level of the specified row or column.

MSDN documentation for Range.OutlineLevel.

◆ GetPageBreak()

XlPageBreak wxAutoExcel::wxExcelRange::GetPageBreak ( )

Returns the location of a page break.

Can be one of the following XlPageBreak constants: xlPageBreakAutomatic, xlPageBreakManual, or xlPageBreakNone.

MSDN documentation for Range.PageBreak.

◆ SetPageBreak()

void wxAutoExcel::wxExcelRange::SetPageBreak ( XlPageBreak pageBreak)

Sets the location of a page break.

Can be one of the following XlPageBreak constants: xlPageBreakAutomatic, xlPageBreakManual, or xlPageBreakNone.

MSDN documentation for Range.PageBreak.

◆ GetPrecedents()

wxExcelRange wxAutoExcel::wxExcelRange::GetPrecedents ( )

◆ GetPrefixCharacter()

wxString wxAutoExcel::wxExcelRange::GetPrefixCharacter ( )

Returns the prefix character for the cell.

MSDN documentation for Range.PrefixCharacter.

◆ GetPrevious()

wxExcelRange wxAutoExcel::wxExcelRange::GetPrevious ( )

Returns a range represnting the next cell.

MSDN documentation for Range.Previous.

◆ GetReadingOrder()

long wxAutoExcel::wxExcelRange::GetReadingOrder ( )

Returns the reading order for the specified object.

Can be one of the following constants: xlRTL (right-to-left), xlLTR (left-to-right), or xlContext.

MSDN documentation for Range.ReadingOrder.

◆ SetReadingOrder()

void wxAutoExcel::wxExcelRange::SetReadingOrder ( long readingOrder)

Sets the reading order for the specified object, xlRTL (right-to-left), xlLTR (left-to-right), or xlContext.

MSDN documentation for Range.ReadingOrder.

◆ GetResize()

wxExcelRange wxAutoExcel::wxExcelRange::GetResize ( long * rowSize = NULL,
long * columnSize = NULL )

Resizes the specified range.

Returns a Range Represents the resized range.

MSDN documentation for Range.Resize.

◆ GetRow()

long wxAutoExcel::wxExcelRange::GetRow ( )

Returns the number of the first row of the first area in the range.

MSDN documentation for Range.Row.

◆ GetRowHeight()

double wxAutoExcel::wxExcelRange::GetRowHeight ( )

If all rows in the range have same height returns the height in points else returns -1.

Returns -2 on error.

MSDN documentation for Range.RowHeight.

◆ SetRowHeight()

void wxAutoExcel::wxExcelRange::SetRowHeight ( double rowHeight)

Sets the height of all the rows in the range specified, measured in points.

MSDN documentation for Range.RowHeight.

◆ GetShowDetail()

bool wxAutoExcel::wxExcelRange::GetShowDetail ( )

True if the outline is expanded for the specified range (so that the detail of the column or row is visible).

The specified range must be a single summary column or row in an outline. For the PivotItem object (or the Range object if the range is in a PivotTable report), this property is set to True if the item is showing detail.

MSDN documentation for Range.ShowDetail.

◆ SetShowDetail()

void wxAutoExcel::wxExcelRange::SetShowDetail ( bool showDetail)

Expands the outline for the specified range when true, collapses it when false.

The range must be a single summary column or row in an outline.

MSDN documentation for Range.ShowDetail.

◆ GetShrinkToFit()

wxXlTribool wxAutoExcel::wxExcelRange::GetShrinkToFit ( )

Returns tb_true if the text shrinks to fit into the cell in all cells in the range.

Returns tb_default if this property is not the same in all cells in the range.

MSDN documentation for Range.ShrinkToFit.

◆ SetShrinkToFit()

void wxAutoExcel::wxExcelRange::SetShrinkToFit ( bool shrinkToFit)

Set true if the text is to fit into the cell.

MSDN documentation for Range.ShrinkToFit.

◆ GetSparklineGroups()

wxExcelSparklineGroups wxAutoExcel::wxExcelRange::GetSparklineGroups ( )

Returns a SparklineGroups object that represents an existing group of sparklines from the specified range.

Since Excel 2010.

MSDN documentation for Range.SparklineGroups.

◆ GetStyle()

wxExcelStyle wxAutoExcel::wxExcelRange::GetStyle ( )

Returns the style of the range.

MSDN documentation for Range.Style.

◆ SetStyle()

void wxAutoExcel::wxExcelRange::SetStyle ( wxExcelStyle style)

Sets the style of the range.

MSDN documentation for Range.Style.

◆ GetSummary()

bool wxAutoExcel::wxExcelRange::GetSummary ( )

True if the range is an outlining summary row or column.

The range should be a row or a column.

MSDN documentation for Range.Summary.

◆ GetText()

wxString wxAutoExcel::wxExcelRange::GetText ( )

Returns the text value as seen by user in MS Excel.

The range must comprise of a single cell, else an empty string is returned.

MSDN documentation for Range.Text.

◆ GetTop()

double wxAutoExcel::wxExcelRange::GetTop ( )

Returns the distance, in points, from the top edge of row 1 to the top edge of the range.

MSDN documentation for Range.Top.

◆ GetUseStandardHeight()

wxXlTribool wxAutoExcel::wxExcelRange::GetUseStandardHeight ( )

Returns tb_true if the row height of the Range object equals the standard height of the sheet.

Returns tb_default if the range contains more than one row and the rows are not all the same height.

MSDN documentation for Range.UseStandardHeight.

◆ SetUseStandardHeight()

void wxAutoExcel::wxExcelRange::SetUseStandardHeight ( bool useStandardHeight)

Whether all cells in the range should use standard row height of the sheet.

MSDN documentation for Range.UseStandardHeight.

◆ GetUseStandardWidth()

wxXlTribool wxAutoExcel::wxExcelRange::GetUseStandardWidth ( )

Returns tb_true if the column width of the Range object equals the standard width of the sheet.

Returns tb_default if the range contains more than one column and the columns are not all the same width.

MSDN documentation for Range.UseStandardWidth.

◆ SetUseStandardWidth()

void wxAutoExcel::wxExcelRange::SetUseStandardWidth ( bool useStandardWidth)

Whether all cells in the range should use standard column width of the sheet.

MSDN documentation for Range.UseStandardWidth.

◆ GetValidation()

wxExcelValidation wxAutoExcel::wxExcelRange::GetValidation ( )

Returns the Validation object that represents data validation for the specified range.

MSDN documentation for Range.Validation.

◆ GetValue()

wxVariant wxAutoExcel::wxExcelRange::GetValue ( )

Returns the value(s) of the specified range.

MSDN documentation for Range.Value.

Due to wxWidgets internals, GetValue and SetValue work asymetrically by default. For example, let's have a range with address A1:C2, i.e. three columns and two rows. When you ask Excel for values, it puts them into a two-dimensional array. By default, wxVariant does not support multidimensional arrays, so you get values in wxVariant as a single list ordered by columns, in our example it will contain values of cells in this order: A1, A2, B1, B2, C1, C2.

See bulkdata sample to see how efficiently transfer large numbers of values from/to MS Excel as a two-dimensional wxSafeArray.

See also
SetConvertVariantFlags_()

◆ operator wxVariant()

wxAutoExcel::wxExcelRange::operator wxVariant ( )
inline

Same as calling GetValue();.

◆ SetValue()

void wxAutoExcel::wxExcelRange::SetValue ( const wxVariant & value)

Sets the value for a Range.

Passing a null wxVariant clears the cells.

MSDN documentation for Range.Value.

Be aware that the automation LCID (see wxExcelObject::SetAutomationLCID_()) also affects how MS Excel may interpret the values passed as strings. E.g. "1,234" may be converted to an integer with value 1234 if the locale uses comma for the thousand separator and the decimal period but the same string may be converted to a float with value 1.234 if the locale has decimal comma.

Check bulkdata sample for an example how to efficiently transfer data to large two-dimensional Ranges.

See also
SetConvertVariantFlags_()

◆ operator=()

void wxAutoExcel::wxExcelRange::operator= ( const wxVariant & value)
inline

Same as calling SetValue();.

◆ GetValue2()

wxVariant wxAutoExcel::wxExcelRange::GetValue2 ( )

Works almost like GetValue(), except that it returns DateTime and Currency as doubles and not their respective types.

Also see GetValue() for some oddities of this function.

MSDN documentation for Range.Value2.

◆ SetValue2()

void wxAutoExcel::wxExcelRange::SetValue2 ( const wxVariant & value)

Sets the cell value.

Also see SetValue() for some oddities of this function.

MSDN documentation for Range.Value2.

◆ GetVerticalAlignment()

long wxAutoExcel::wxExcelRange::GetVerticalAlignment ( )

Returns the vertical alignment of the specified object.

MSDN documentation for Range.VerticalAlignment.

◆ SetVerticalAlignment()

void wxAutoExcel::wxExcelRange::SetVerticalAlignment ( long verticalAlignment)

Sets the vertical alignment of the specified object.

MSDN documentation for Range.VerticalAlignment.

◆ GetWidth()

double wxAutoExcel::wxExcelRange::GetWidth ( )

Returns the width, in units, of the range.

MSDN documentation for Range.Width.

◆ GetWorksheet()

wxExcelWorksheet wxAutoExcel::wxExcelRange::GetWorksheet ( )

Returns the worksheet containing the specified range.

MSDN documentation for Range.Worksheet.

◆ GetWrapText()

wxXlTribool wxAutoExcel::wxExcelRange::GetWrapText ( )

Returns tb_true if all cells in the range wrap the text, tb_false if all cells in the range do not wrap the text, and tb_default if some cells wrap the text and some do not.

MSDN documentation for Range.WrapText.

◆ SetWrapText()

void wxAutoExcel::wxExcelRange::SetWrapText ( bool wrapText)

Set to true if Microsoft Excel should wrap the text in the object in all cells in the range.

MSDN documentation for Range.WrapText.

◆ GetAutoExcelObjectName_()

virtual wxString wxAutoExcel::wxExcelRange::GetAutoExcelObjectName_ ( ) const
inlinevirtual

Returns "Range".

Reimplemented from wxAutoExcel::wxExcelRangeOwner.

◆ GetConvertVariantFlags_()

long wxAutoExcel::wxExcelRange::GetConvertVariantFlags_ ( )

See wxAutomationObject::GetConvertVariantFlags().

◆ SetConvertVariantFlags_()

bool wxAutoExcel::wxExcelRange::SetConvertVariantFlags_ ( long flags)

This method, wrapping wxAutomationObject::SetConvertVariantFlags() can be very useful for efficient data transfer to/from Excel, using wxOleConvertVariant_ReturnSafeArrays as a value of flags, see bulkdata sample for an example.

See also
GetValue(), SetValue(), GetValue2(), SetValue2()

◆ GetValues_()

bool wxAutoExcel::wxExcelRange::GetValues_ ( wxExcelRangeData & data,
bool value2 = true )

Gets the values of all cells of the range at once.

When value2 is true, the values are those of Value2, i.e. without dates and currency values, otherwise those of Value. For a range with several areas, Excel returns the values of the first area only.

Returns true if the values were obtained.

See also
SetValues_(), GetFormulas_()

◆ SetValues_()

bool wxAutoExcel::wxExcelRange::SetValues_ ( const wxExcelRangeData & data,
bool value2 = true )

Sets the values of all cells of the range at once.

data must have the same number of rows and columns as the range, which must have a single area. Otherwise, nothing is set and an error of the Err_InvalidArgument kind is reported. A null wxVariant clears its cell. When value2 is true, Value2 is set, otherwise Value.

Returns true if the values were set.

See also
GetValues_(), SetFormulas_()

◆ GetFormulas_()

bool wxAutoExcel::wxExcelRange::GetFormulas_ ( wxExcelRangeData & data)

Gets the formulas of all cells of the range at once, in A1-style notation and in the language of the macro.

Cells without a formula have their constant value as a string, empty cells an empty string.

Returns true if the formulas were obtained.

See also
SetFormulas_(), GetValues_()

◆ SetFormulas_()

bool wxAutoExcel::wxExcelRange::SetFormulas_ ( const wxExcelRangeData & data)

Sets the formulas of all cells of the range at once, in A1-style notation and in the language of the macro.

A string which is not a formula sets the cell to a constant value.

data must have the same number of rows and columns as the range, which must have a single area. Otherwise, nothing is set and an error of the Err_InvalidArgument kind is reported.

Returns true if the formulas were set.

See also
GetFormulas_(), SetValues_()

◆ FindAll_()

bool wxAutoExcel::wxExcelRange::FindAll_ ( const wxVariant & what,
wxExcelRangeVector & found,
XlFindLookIn * lookIn = NULL,
XlLookAt * lookAt = NULL,
XlSearchOrder * searchOrder = NULL,
wxXlTribool matchCase = wxDefaultXlTribool,
wxXlTribool matchByte = wxDefaultXlTribool,
wxXlTribool searchFormat = wxDefaultXlTribool )

Finds all the cells of the range matching the conditions, using Find() and FindNext(), and puts them into found, in the order of searchOrder, starting with the cell in the upper-left corner of the range.

The arguments have the same meaning as for Find().

Returns true if the search succeeded, even if nothing was found.

Each cell found takes two calls to Excel, so this can be slow for many matching cells.

◆ begin()

iterator wxAutoExcel::wxExcelRange::begin ( )
inline

Returns the iterator referring to the first item of the range, or past the last item, which allows iterating over the items with a range-based for loop, see wxExcelCollectionIterator.

The items are those returned by operator[](), so the cells, counting across the rows, of a range of cells, the rows of a range returned by GetRows(), or the columns of a range returned by GetColumns(). A row or column obtained this way is a range of rows or columns too, so use its GetCells() to iterate over its cells:

// range is a valid wxExcelRange
for ( wxExcelRange row : range.GetRows() )
{
for ( wxExcelRange cell : row.GetCells() )
wxLogMessage("%s: %s", cell.GetAddress(), cell.GetText());
}
Represents Microsoft Excel Range, i.e.
Definition wxAutoExcelRange.h:23
wxExcelRange GetRows()
wxExcelWorksheet: Returns a Range representing all the rows on the specified worksheet.
wxExcelRange GetCells(long *row=NULL, long *column=NULL)
wxExcelApplication: Returns a Range representing all the cells on the active worksheet.

For a range with several areas, iterate over its areas, see GetAreas(), and then over each area. The number of cells, see GetCount(), cannot be obtained for a range with more than 2,147,483,647 cells, so there is nothing to iterate over.