Are there any event that gets fired when you execute a function inside a Cell

R

Robin

Hello
Is there any special event that excel fires when a specific
calculation is completed in a CELL. For example

in Cell A5 I have =FuncLookAtAllDBRequest("SomeStringID") When this
function completes I need to know whether I can call some macro to
send me an email using VBA. Are there any events that tell
BeforeFunctionCalled(".....") or AfterFunctionCalled(".....") etc....
Is this already there is Excel or are there any VBA code sample that
will do it.

I have several functions been called within a sheet they do scientific
calculation and I need to notify the needful people when they complete
the calculations etc....

I would really appreciate if someone tells me how to do it and that I
can do it in C# or C++ if not VBA is cool too.

Thanks
Robin
 
H

Harlan Grove

Is there any special event that excel fires when a specific
calculation is completed in a CELL. For example

in Cell A5 I have =FuncLookAtAllDBRequest("SomeStringID") When this
function completes I need to know whether I can call some macro to
send me an email using VBA. Are there any events that tell
BeforeFunctionCalled(".....") or AfterFunctionCalled(".....") etc....
Is this already there is Excel or are there any VBA code sample that
will do it.
...

The closest you'll get is the use either Calculate or SheetCalculate event
handlers to check the values in specified cells.
 
J

Jonathan Rynd

(e-mail address removed) (Robin) wrote in @posting.google.com:
in Cell A5 I have =FuncLookAtAllDBRequest("SomeStringID") When this
function completes I need to know whether I can call some macro to
send me an email using VBA.

Here's how I'd do it:

Write a "wrapper" function in VB, call it by a different name, for
instance MyFuncLookAtAllDBRequest.

This function just calls worksheetfunction funclookatalldbrequest(param)
and then sends the email to you.

function MyFuncLookAtAllDBRequest(stringID as String)
MyFuncLookAtAllDBRequest = Application.WorksheetFunction.Min(stringID)
SendEmail
end function

then change the spreadsheet to call MyFuncLookAtAllDBRequeest instead of
FuncLookAtAllDBRequest.
 
J

Jonathan Rynd

function MyFuncLookAtAllDBRequest(stringID as String)
MyFuncLookAtAllDBRequest = Application.WorksheetFunction.Min(stringID)
SendEmail
end function

Oops, that should be
Function MyFuncLookAtAllDBRequest(stringID as String)
MyFuncLookAtAllDBRequest = _
Application.WorksheetFunction.FuncLookAtAllDBRequest(stringID)
SendEmail
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top