From where is my UDF called?
PS.... I wrote:
"joeu2004" wrote:
Dim s as String
On Error Resume Next
s = Application.Caller.Address
On Error GoTo 0
If Len(s) = 0 Then MyFunction = False: Exit Function
I began to wonder why you want this.
If your real intention is simply to prevent MyFunction from being called
from Excel worksheets, perhaps it would be sufficient to make MyFunction
private, to wit:
Private Function MyFunction(...) As Variant
Potential downside: MyFunction can be called only from procedures in the
same module.
I think you could work around that limitation by putting MyFunction into a
class module.
|