Você está na página 1de 36

AboveAverage Object

Action Object
Actions Object
AddIn Object
AddIns Object
AddIns2 Object
Adjustments Object
AllowEditRange Object
AllowEditRanges Object
Application Object
Areas Object
AutoCorrect Object
AutoFilter Object
AutoRecover Object
Axes Object
Axis Object
AxisTitle Object
Border Object
Borders Object
CalculatedFields Object
CalculatedItems Object
CalculatedMember Object
CalculatedMembers Object
CalloutFormat Object
CategoryCollection Object
CellFormat Object
Characters Object
Chart Object
ChartArea Object
ChartCategory Object
ChartFormat Object
ChartGroup Object
ChartGroups Object
ChartObject Object
ChartObjects Object
Charts Object
ChartTitle Object
ChartView Object
ColorFormat Object
ColorScale Object
ColorScaleCriteria Object
ColorScaleCriterion Object
ColorStop Object
ColorStops Object
Comment Object
Comments Object
ConditionValue Object
Connections Object
ConnectorFormat Object
ControlFormat Object
CubeField Object
CubeFields Object
CustomProperties Object
CustomProperty Object
CustomView Object
CustomViews Object
Databar Object
DataBarBorder Object
DataFeedConnection Object
DataLabel Object
DataLabels Object
DataTable Object
DefaultWebOptions Object
Dialog Object
Dialogs Object
DialogSheetView Object
DisplayFormat Object
DisplayUnitLabel Object
DownBars Object
DropLines Object
Error Object
ErrorBars Object
ErrorCheckingOptions Object
Errors Object
FileExportConverter Object
FileExportConverters Object
FillFormat Object
Filter Object
Filters Object
Floor Object
Font Object
FormatColor Object
FormatCondition Object
FormatConditions Object
FreeformBuilder Object
FullSeriesCollection Object
Graphic Object
Gridlines Object
GroupShapes Object
HeaderFooter Object
HiLoLines Object
HPageBreak Object
HPageBreaks Object
Hyperlink Object
Hyperlinks Object
Icon Object
IconCriteria Object
IconCriterion Object
IconSet Object
IconSetCondition Object
IconSets Object
Interior Object
IRtdServer Object
IRTDUpdateEvent Object
LeaderLines Object
Legend Object
LegendEntries Object
LegendEntry Object
LegendKey Object
LinearGradient Object
LineFormat Object
LinkFormat Object
ListColumn Object
ListColumns Object
ListDataFormat Object
ListObject Object
ListObjects Object
ListRow Object
ListRows Object
Mailer Object
ModelChanges Object
ModelColumnChange Object
ModelColumnChanges Object
ModelColumnName Object
ModelColumnNames Object
ModelConnection Object
ModelFormatBoolean Object
ModelMeasureName Object
ModelFormatCurrency Object
ModelMeasureNames Object
ModelFormatDate Object
ModelRelationship Object
ModelFormatDecimalNumber Object
ModelRelationships Object
ModelFormatGeneral Object
ModelTable Object
ModelTableColumn Object
ModelFormatPercentageNumber Object
ModelTableColumns Object
ModelFormatScientificNumber Object
ModelTableNameChange Object
ModelFormatWholeNumber Object
ModelMeasure Object
ModelTableNameChanges Object
ModelTableNames Object
ModelTables Object
ModelMeasures Object
ModuleView Object
MultiThreadedCalculation Object
Name Object
Names Object
NegativeBarFormat Object
ODBCConnection Object
ODBCError Object
ODBCErrors Object
OLEDBConnection Object
OLEDBError Object
OLEDBErrors Object
OLEFormat Object
OLEObject Object
OLEObjects Object
Outline Object
Page Object
Pages Object
PageSetup Object
Pane Object
Panes Object
Parameter Object
Parameters Object
Phonetic Object
Phonetics Object
PictureFormat Object
PivotAxis Object
PivotCache Object
PivotCaches Object
PivotCell Object
PivotField Object
PivotFields Object
PivotFilter Object
PivotFilters Object
PivotFormula Object
PivotFormulas Object
PivotItem Object
PivotItemList Object
PivotItems Object
PivotLayout Object
PivotLine Object
PivotLineCells Object
PivotLines Object
PivotTable Object
PivotTableChangeList Object
PivotTables Object
PivotValueCell Object
PlotArea Object
Point Object
Points Object
ProtectedViewWindow Object
ProtectedViewWindows Object
Protection Object
PublishObject Object
PublishObjects Object
Queries Object
QueryTable Object
QueryTables Object
QuickAnalysis Object
Range Object
Ranges Object
RecentFile Object
RecentFiles Object
RectangularGradient Object
Research Object
RoutingSlip Object
RTD Object
Scenario Object
Scenarios Object
Series Object
SeriesCollection Object
SeriesLines Object
ServerViewableItems Object
ShadowFormat Object
Shape Object
ShapeNode Object
ShapeNodes Object
ShapeRange Object
Shapes Object
Sheets Object
SheetViews Object
Slicer Object
SlicerCache Object
SlicerCacheLevel Object
SlicerCacheLevels Object
SlicerCaches Object
SlicerItem Object
SlicerItems Object
SlicerPivotTables Object
Slicers Object
Sort Object
SortField Object
SortFields Object
SparkAxes Object
SparkColor Object
SparkHorizontalAxis Object
Sparkline Object
SparklineGroup Object
SparklineGroups Object
SparkPoints Object
SparkVerticalAxis Object
Speech Object
SpellingOptions Object
Style Object
Styles Object
Tab Object
TableObject Object
TableStyle Object
TableStyleElement Object
TableStyleElements Object
TableStyles Object
TextConnection Object
TextEffectFormat Object
TextFrame Object
TextFrame2 Object
ThreeDFormat Object
TickLabels Object
TimelineState Object
TimelineViewState Object
Top10 Object
TreeviewControl Object
Trendline Object
Trendlines Object
UniqueValues Object
UpBars Object
UsedObjects Object
UserAccess Object
UserAccessList Object
Validation Object
ValueChange Object
VPageBreak Object
VPageBreaks Object
Walls Object
Watch Object
Watches Object
WebOptions Object
Window Object
Windows Object
Workbook Object
WorkbookConnection Object
Workbooks Object
Worksheet Object
WorksheetDataConnection Object
WorksheetFunction Object
Worksheets Object
WorksheetView Object
XmlDataBinding Object
XmlMap Object
XmlMaps Object
XmlNamespace Object
XmlNamespaces Object
XmlSchema Object
WorkbookQuery Object
XmlSchemas Object
XPath Object
Enumerations
Graph Visual Basic reference
AboveAverage Object (Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Represents an above average visual of a conditional formatting rule. Applying a color or


fill to a range or selection to help you see the value of a cells relative to other cells.
Remarks
All conditional formatting objects are contained within a FormatConditions collection
object, which is a child of a Range collection. You can create an above average
formatting rule by using either the Add or AddAboveAverage method of
the FormatConditions collection.
Example
The following example builds a dynamic data set and applies color to the above average
values through conditional formatting rules.
VBA
Sub AboveAverageCF()

' Building data for Melanie


Range("A1").Value = "Name"
Range("B1").Value = "Number"
Range("A2").Value = "Melanie-1"
Range("A2").AutoFill Destination:=Range("A2:A26"), Type:=xlFillDefault
Range("B2:B26").FormulaArray = "=INT(RAND()*101)"
Range("B2:B26").Select

' Applying Conditional Formatting to items above the average. Should appear
green fill and dark green font.
Selection.FormatConditions.AddAboveAverage
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
Selection.FormatConditions(1).AboveBelow = xlAboveAverage
With Selection.FormatConditions(1).Font
.Color = -16752384
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13561798
.TintAndShade = 0
End With
MsgBox "Added an Above Average Conditional Format to Melanie's data. Press F9
to update values.", vbInformation

End Sub

Methods
Name

Delete

ModifyAppliesToRange

SetFirstPriority

SetLastPriority
Properties
Name

AboveBelow

Application

AppliesTo

Borders

CalcFor

Creator

Font

Interior

NumberFormat

NumStdDev

Parent

Priority
PTCondition

ScopeType

StopIfTrue

Type

AboveAverage.AboveBelow
Property (Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns or sets one of the constants of the XlAboveBelow enumeration, specifying if


the conditional formatting rule looks for cell values above or below the range average or
standard deviation.
Syntax
expression .AboveBelow
expression A variable that represents an AboveAverage object.

AboveAverage.Application
Property (Excel)
Office 2013 and later
Other Versions
Contribute to this content
Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

When used without an object qualifier, this property returns an Application object that
represents the Microsoft Excel application. When used with an object qualifier, this
property returns an Application object that represents the creator of the specified
object. Read-only.
Syntax
expression .Application
expression A variable that represents an AboveAverage object.
Remarks
You can use this property with an OLE Automation object to return the application of
that object

AboveAverage.AppliesTo
Property (Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns a Range object specifying the cell range to which the formatting rule is applied.
Syntax
expression .AppliesTo
expression A variable that represents an AboveAverage object

AboveAverage.Borders
Property (Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns a Borders collection that specifies the formatting of cell borders if the
conditional formatting rule evaluates to True. Read-only.
Syntax
expression .Borders
expression A variable that represents an AboveAverage object.
Remarks
For a conditional formatting object, you can only set the properties for the top, bottom,
and side borders of the cell.

AboveAverage.CalcFor
Property (Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns or sets one of the constants of the XlCalcFor enumeration, which specifies the
scope of data to be evaluated for the conditional format in a PivotTable report.
Syntax
expression .CalcFor
expression A variable that represents an AboveAverage object.
Remarks
This property is applicable only when the conditional format is being applied to data in a
PivotTable report.
This property can be set to xlAllValues, xlColGroups, or xlRowGroups only if
the AboveAverage.ScopeType property is set to xlFieldsScope.

AboveAverage.Creator
Property (Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns a 32-bit integer that indicates the application in which this object was created.
Read-only Long.
Syntax
expression .Creator
expression A variable that represents an AboveAverage object.
Remarks
If the object was created in Microsoft Excel, this property returns the string XCEL, which
is equivalent to the hexadecimal number 5843454C. The Creator property is designed
to be used in Microsoft Excel for the Macintosh, where each application has a four-
character creator code. For example, Microsoft Excel has the creator code XCEL.
Example
This example displays a message about the creator of an Excel workbook.
VBA
Sub FindCreator()

Dim myObject As Excel.Workbook


Set myObject = ActiveWorkbook
If myObject.Creator = &h5843454c Then
MsgBox "This is a Microsoft Excel object."
Else
MsgBox "This is not a Microsoft Excel object."
End If

End Sub
AboveAverage.Delete Method
(Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Deletes the specified conditional formatting rule object.


Syntax
expression .Delete
expression A variable that represents an AboveAverage object.

AboveAverage.Font Property
(Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns a Font object that specifies the font formatting if the conditional formatting rule
evaluates to True. Read-only.
Syntax
expression .Font
expression A variable that represents an AboveAverage object.
Remarks
Not all properties of the Font object are supported for a conditional formatting object.
You can set the font style, underline, color, and strikethrough attributes.

AboveAverage.Interior
Property (Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns an Interior object that specifies a cell's interior attributes for a conditional
formatting rule that evaluates to True. Read-only.
Syntax
expression .Interior
expression A variable that represents an AboveAverage object.

AboveAverage.ModifyAppliesT
oRange Method (Excel)
Office 2013 and later

Other Versions

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.
Sets the cell range to which this formatting rule applies.

Syntax

expression .ModifyAppliesToRange(Range)

expression A variable that represents an AboveAverage object.

Parameters

Data
Name Required/Optional Description
Type

Rang Required Range The range to which this formatting rule will be
e applied.

Remarks

The range must be in the A1 reference style and be entirely contained within the sheet
that is the parent of the FormatConditions collection. It can include the range
operator (a colon), the intersection operator (a space), or the union operator (a comma).
Dollar signs can also be used but they are ignored.

You can also use a local defined name in any part of the range, but the name must be in
the language of the macro.

AboveAverage.NumberForma
t Property (Excel)
Office 2013 and later
Other Versions
Contribute to this content
Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns or sets the number format applied to a cell if the conditional formatting rule
evaluates to True. Read/write Variant.
Syntax
expression .NumberFormat
expression A variable that represents an AboveAverage object.
Remarks
The number format is specified using the same format codes displayed on
the Number tab of the Format Cells dialog box. You can use a built-in number format,
for example "General", or create a custom number format.

AboveAverage.NumStdDev
Property (Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns or sets the numeric standard deviation for an AboveAverage object.


Read/write Long.
Syntax
expression .NumStdDev
expression A variable that represents an AboveAverage object.

AboveAverage.Parent
Property (Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns the parent object for the specified object. Read-only.


Syntax
expression .Parent
expression A variable that represents an AboveAverage object.

AboveAverage.Priority
Property (Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns or sets the priority value of the conditional formatting rule. The priority
determines the order of evaluation when multiple conditional formatting rules exist in a
worksheet.
Syntax
expression .Priority
expression A variable that represents an AboveAverage object.

AboveAverage.PTCondition
Property (Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns a Boolean value indicating if the conditional format is being applied to a


PivotTable. Read-only.
Syntax
expression .PTCondition
expression A variable that represents an AboveAverage object.

AboveAverage.ScopeType
Property (Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns or sets one of the constants of the XlPivotConditionScope enumeration,


which determines the scope of the conditional format when it is applied to a PivotTable.
Syntax
expression .ScopeType
expression A variable that represents an AboveAverage object.

AboveAverage.SetFirstPriority
Method (Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Sets the priority value for this conditional formatting rule to "1" so that it will be
evaluated before all other rules on the worksheet.
Syntax
expression .SetFirstPriority
expression A variable that represents an AboveAverage object.
Remarks
When you have multiple conditional formatting rules in a worksheet, if the rule was not
previously set to priority "1", this method will cause the priority of all other existing
rules on the worksheet to be increased by one.

Note

Priority levels for conditional formatting rules are applied on a worksheet-level basis.

AboveAverage.SetLastPriority
Method (Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Sets the evaluation order for this conditional formatting rule so it is evaluated after all
other rules on the worksheet.
Syntax
expression .SetLastPriority
expression A variable that represents an AboveAverage object.
Remarks
The actual vaule of the priority will be equal to the total number of conditional
formatting rules on the worksheet. When you have multiple conditional formatting rules
in a worksheet, this method will cause the priority of rules that had a priority value
greater than this rule to be increased by one.

Note

Priority levels for conditional formatting rules are applied on a worksheet-level basis.

AboveAverage.StopIfTrue
Property (Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns or sets a Boolean value that determines if additional formatting rules on the
cell should be evaluated if the current rule evaluates to True.
Syntax
expression .StopIfTrue
expression A variable that represents an AboveAverage object.
Remarks
To support backward compatibility, the default value for this property is True, which is
the opposite behavior of a formatting rule created in the user interface.

AboveAverage.Type Property
(Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns one of the constants of the XlFormatConditionType enumeration, which


specifies the type of conditional format. Read-only.
Syntax
expression .Type
expression A variable that represents an AboveAverage object.
Remarks
This property will always return a Long value of "12", which is equivalent
to xlAboveAverageCondition.

Action Object (Excel)


Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Represents an action to be executed in a Pivottable or sheet data.


Methods
Name

Execute
Properties
Name
Application

Caption

Content

Coordinate

Creator

Name

Parent

Type

Action.Application Property
(Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

When used without an object qualifier, this property returns an Application object that
represents the Microsoft Excel application. When used with an object qualifier, this
property returns an Application object that represents the creator of the specified
object. Read-only.
Syntax
expression .Application
expression A variable that represents an Action object.
Remarks
You can use this property with an OLE Automation object to return the application of
that object.
Action.Caption Property
(Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns the caption assigned to the Action object. Read-only String.


Syntax
expression .Caption
expression A variable that represents an Action object.

Action.Content Property
(Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns the content associated to the Action object. Read-only String.


Syntax
expression .Content
expression A variable that represents an Action object.
ction.Coordinate Property
(Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns the coordinate property of the Action object. Read-only


Syntax
expression .Coordinate
expression A variable that represents an Action object.

Action.Creator Property
(Excel)
Office 2013 and later

Other Versions

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns a 32-bit integer that indicates the application in which this object was created.
Read-only Long.
Syntax

expression .Creator

expression An expression that returns a Action object.

Return Value

XlCreator

Remarks

If the object was created in Microsoft Excel, this property returns the string XCEL, which
is equivalent to the hexadecimal number 5843454C. The Creator property is designed
to be used in Microsoft Excel for the Macintosh, where each application has a four-
character creator code. For example, Microsoft Excel has the creator code XCEL.

ction.Execute Method (Excel)


Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Performs the specified action.


Syntax
expression .Execute
expression A variable that represents an Action object.

Action.Name Property (Excel)


Office 2013 and later
Other Versions
Contribute to this content
Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns the name of the object. Read-only String.


Syntax
expression .Name
expression A variable that represents an Action object.

Action.Parent Property (Excel)


Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns the parent object for the specified object. Read-only.


Syntax
expression .Parent
expression A variable that represents an Action object.

Action.Type Property (Excel)


Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.
Returns the action type. Read-only XlActionType.
Syntax
expression .Type
expression A variable that represents an Action object.

Actions.Application Property
(Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

When used without an object qualifier, this property returns an Application object that
represents the Microsoft Excel application. When used with an object qualifier, this
property returns an Application object that represents the creator of the specified
object. Read-only.
Syntax
expression .Application
expression A variable that represents an Actions object.
Remarks
You can use this property with an OLE Automation object to return the application of
that object.

Actions.Count Property
(Excel)
Office 2013 and later
Other Versions
Contribute to this content
Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns the number of objects in the collection. Read-only Long.


Syntax
expression .Count
expression A variable that represents an Actions object.

Actions.Creator Property
(Excel)
Office 2013 and later

Other Versions

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns a 32-bit integer that indicates the application in which this object was created.
Read-only Long.

Syntax

expression .Creator

expression An expression that returns a Actions object.

Return Value

XlCreator
Remarks

Actions.Item Property (Excel)


Office 2013 and later

Other Versions

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns a Actions object that represents a collection of actions in a workbook. Read-


only.

Syntax

expression .Item(Index)

expression A variable that represents an Actions object.

Parameters

Name Required/Optional Data Type Description

Index Required Variant Index value of the action.

Actions.Parent Property
(Excel)
Office 2013 and later
Other Versions
Contribute to this content
Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns the parent object for the specified object. Read-only.


Syntax
expression .Parent
expression A variable that represents an Actions object.

AddIn Object (Excel)


Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Represents a single add-in, either installed or not installed.


Remarks
The AddIn object is a member of the AddIns collection. The AddIns collection contains
a list of all the add-ins available to Microsoft Excel, regardless of whether theyre
installed. This list corresponds to the list of add-ins displayed in the Add-Ins dialog box.
Example
Use AddIns(index), where index is the add-in title or index number, to return a
single AddIn object. The following example installs the Analysis Toolpak add-in.
VBA
AddIns("analysis toolpak").Installed = True

Dont confuse the add-in title, which appears in the Add-Ins dialog box, with the add-in
name, which is the file name of the add-in. You must spell the add-in title exactly as its
spelled in the Add-Ins dialog box, but the capitalization doesnt have to match.
The index number represents the position of the add-in in the Add-ins available box in
the Add-Ins dialog box. The following example creates a list that contains specified
properties of the available add-ins.
VBA
With Worksheets("sheet1")
.Rows(1).Font.Bold = True
.Range("a1:d1").Value = _
Array("Name", "Full Name", "Title", "Installed")
For i = 1 To AddIns.Count
.Cells(i + 1, 1) = AddIns(i).Name
.Cells(i + 1, 2) = AddIns(i).FullName
.Cells(i + 1, 3) = AddIns(i).Title
.Cells(i + 1, 4) = AddIns(i).Installed
Next
.Range("a1").CurrentRegion.Columns.AutoFit
End With

The Add method adds an add-in to the list of available add-ins but doesnt install the
add-in. Set the Installed property of the add-in to True to install the add-in. To install
an add-in that doesnt appear in the list of available add-ins, you must first use
the Add method and then set the Installed property. This can be done in a single step,
as shown in the following example (note that you use the name of the add-in, not its
title, with the Add method).
VBA

AddIns.Add("generic.xll").Installed = True

Use Workbooks(index) where index is the add-in filename (not title) to return a
reference to the workbook corresponding to a loaded add-in. You must use the file name
because loaded add-ins dont normally appear in the Workbooks collection. This
example sets the wb variable to the workbook for Myaddin.xla.
VBA
Set wb = Workbooks("myaddin.xla")

The following example sets the wb variable to the workbook for the Analysis Toolpak
add-in.
VBA
Set wb = Workbooks(AddIns("analysis toolpak").Name)

If the Installed property returns True, but calls to functions in the add-in still fail, the
add-in may not actually be loaded. This is because the Addin object represents the
existence and installed state of the add-in but doesn't represent the actual contents of
the add-in workbook.To guarantee that an installed add-in is loaded, you should open
the add-in workbook. The following example opens the workbook for the add-in named
"My Addin" if the add-in isnt already present in the Workbooks collection.
VBA
On Error Resume Next ' turn off error checking
Set wbMyAddin = Workbooks(AddIns("My Addin").Name)
lastError = Err
On Error Goto 0 ' restore error checking
If lastError <> 0 Then
' the add-in workbook isn't currently open. Manually open it.
Set wbMyAddin = Workbooks.Open(AddIns("My Addin").FullName)
End If
AddIn.Application Property
(Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

When used without an object qualifier, this property returns an Application object that
represents the Microsoft Excel application. When used with an object qualifier, this
property returns an Application object that represents the creator of the specified
object (you can use this property with an OLE Automation object to return the
application of that object). Read-only.
Syntax
expression .Application
expression A variable that represents an AddIn object.
Example
This example displays a message about the application that created myObject.
VBA
Set myObject = ActiveWorkbook
If myObject.Application.Value = "Microsoft Excel" Then
MsgBox "This is an Excel Application object."
Else
MsgBox "This is not an Excel Application object."
End If

AddIn.CLSID Property (Excel)


Office 2013 and later
Other Versions
Contribute to this content
Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns a read-only unique identifier, or CLSID, identifying an object, as a String.


Syntax
expression .CLSID
expression A variable that represents an AddIn object.

AddIn.Creator Property
(Excel)
Office 2013 and later

Other Versions

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns a 32-bit integer that indicates the application in which this object was created.
Read-only Long.

Syntax

expression .Creator

expression An expression that returns a AddIn object.

Return Value

XlCreator
Remarks

If the object was created in Microsoft Excel, this property returns the string XCEL, which
is equivalent to the hexadecimal number 5843454C. The Creator property is designed
to be used in Microsoft Excel for the Macintosh, where each application has a four-
character creator code. For example, Microsoft Excel has the creator code XCEL.

AddIn.FullName Property
(Excel)
Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns the name of the object, including its path on disk, as a string. Read-only String.
Syntax
expression .FullName
expression A variable that represents an AddIn object.
Example
This example displays the path and file name of every available add-in.
VBA
For Each a In AddIns
MsgBox a.FullName
Next a

ddIn.Installed Property (Excel)


Office 2013 and later
Other Versions
Contribute to this content
Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

True if the add-in is installed or to install the add-in, False if the add-in is uninstalled or
to uninstall the add-in. Read/write Boolean.
Syntax
expression .Installed
expression A variable that represents an AddIn object.
Remarks
Setting this property to True installs the add-in and calls its Auto_Add functions. Setting
this property to False removes the add-in and calls its Auto_Remove functions.
Example
This example uses a message box to display the installation status of the Solver add-in.
VBA
Set a = AddIns("Solver Add-In")
If a.Installed = True Then
MsgBox "The Solver add-in is installed"
Else
MsgBox "The Solver add-in is not installed"
End If

AddIn.IsOpen Property (Excel)


Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns True if the add-in is currently open. Boolean Read-only


Syntax
expression .IsOpen
expression A variable that returns an AddIn object.

AddIn.Name Property (Excel)


Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns a String value that represents the name of the object.


Syntax
expression .Name
expression A variable that represents an AddIn object.

AddIn.Parent Property (Excel)


Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns the parent object for the specified object. Read-only.


Syntax
expression .Parent
expression A variable that represents an AddIn object.

AddIn.Path Property (Excel)


Office 2013 and later
Other Versions
Contribute to this content
Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns a String value that represents the complete path to the Add-in, excluding the
final separator and name of the Add-in.
Syntax
expression .Path
expression A variable that represents an AddIn object.

AddIn.progID Property (Excel)


Office 2013 and later
Other Versions

Contribute to this content


Use GitHub to suggest and submit changes. See our guidelines for contributing to
VBA documentation.

Returns the programmatic identifiers for the object. Read-only String.


Syntax
expression .progID
expression A variable that represents an AddIn object.
Example
This example creates a list of the programmatic identifiers for the OLE objects on
worksheet one.
VBA
rw = 0
For Each o in Worksheets(1).OLEObjects
With Worksheets(2)
rw = rw + 1
.cells(rw, 1).Value = o.ProgId
End With
Next

Você também pode gostar