wxAutoExcel 2.8.1
Loading...
Searching...
No Matches
wxAutoExcel::wxExcelCellControl Class Reference

Represents Microsoft Excel CellControl object, the cell controls, such as checkboxes, of a range. More...

#include <wxAutoExcelCellControl.h>

Inheritance diagram for wxAutoExcel::wxExcelCellControl:
wxAutoExcel::wxExcelObject

Public Member Functions

bool SetCheckbox ()
 Adds a checkbox to all cells of the range, replacing their cell controls.
XlCellControlType GetType ()
 Returns the type of the cell controls of the range, e.g.
virtual wxString GetAutoExcelObjectName_ () const
 Returns "CellControl".
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.
template<typename T, typename = typename std::enable_if<std::is_same<T, bool>::value>::type>
 operator T () 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 HasProperty_ (const wxString &name) const
 Returns true if the automation interface of the object has a property called name, ignoring the case, e.g.
bool HasMethod_ (const wxString &name) const
 Returns true if the automation interface of the object has a method called name, ignoring the case, e.g.
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

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...
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 CellControl object, the cell controls, such as checkboxes, of a range.

Since Microsoft 365 (2024).

A cell with a checkbox has the Boolean value of the checkbox, so the checkbox is checked and unchecked by setting the value of the cell to true or false.

See also
wxExcelRange::GetCellControl(), wxExcelRange::ResetContents(), wxExcelRange::RemoveControls()

Member Function Documentation

◆ SetCheckbox()

bool wxAutoExcel::wxExcelCellControl::SetCheckbox ( )

Adds a checkbox to all cells of the range, replacing their cell controls.

The values of the cells are not changed, empty cells get the value false.

MSDN documentation for CellControl.

◆ GetType()

XlCellControlType wxAutoExcel::wxExcelCellControl::GetType ( )

Returns the type of the cell controls of the range, e.g.

xlTypeCheckbox, or xlTypeNone for cells without a cell control.

When the cells of the range have cell controls of different types, including cells without a cell control, Excel returns no value, so this returns xlTypeNone and IsLastResultNull_() returns true.

MSDN documentation for CellControl.

◆ GetAutoExcelObjectName_()

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

Returns "CellControl".

Reimplemented from wxAutoExcel::wxExcelObject.