Программное обеспечение

что делает свойство caller объекта application?? Вопрос по VBA в Excel

Andrey Civilev
Andrey Civilev
584
Excel Developer
Reference

Application.Caller
PropertyReturns information about how
Visual Basic was called (for more information, see the Remarks section).
Syntax
expression.Caller(Index)
expression A variable that represents an
Application object.
Parameters

Name
Required/Optional
Data Type
Description

Index
Optional
Variant
An index to the array. This argument is used only when the
property returns an array (for more information, see the Remarks
section).

Remarks

This property returns information about how Visual Basic was called, as shown
in the following table.

Caller
Return value

A custom function entered in a single cell
A Range object specifying that cell

A custom function that is part of an array formula in a range of cells
A Range object specifying that range of cells

An Auto_Open, Auto_Close, Auto_Activate, or Auto_Deactivate macro
The name of the document as text

A macro set by either the OnDoubleClick or OnEntry property
The name of the chart object identifier or cell reference (if applicable) to
which the macro applies

The Macro dialog box (Tools menu), or
any caller not described above
The #REF! error value

Example

This example displays information about how Visual Basic was called.

Visual Basic for Applications

Select Case TypeName(Application.Caller)
Case "Range"
v = Application.Caller.Address
Case "String"
v = Application.Caller
Case "Error"
v = "Error"
Case Else
v = "unknown"
End Select
MsgBox "caller = " & v
Алмат Тулькибаев
Алмат Тулькибаев
65 597
Лучший ответ
Andrey Civilev да я тоже могу скопировать справку по VBA но смысл оператора caller не сановится очевидным, но спасибо за попытку