Making Changes to Cells from a user defined function

E

Elliot

Hi,

I know that from vba a udf (and any other code called by that udf) may not
alter the worksheet in any way.

However i have an addin from another product, and it has functions that do
more than just return a value to that cell. Does this require a call to a
dll ??

I tried implementing an asynchronous call (to ADO) and wired up an event but
that just made excel crash.

Thanks Elliot
 
N

NickHK

Elliot,
I imagine the code in the add-In is driven by a button or menu click, or
triggered by an Excel event.
If started any of these ways, your code has freedom to the whole Excel
interface.
Whilst there may be ways of exceeding the bounds of a UDF, I would question
your real need to do so, as you would be going against the design of Excel .

NickHK
 
T

Tom Ogilvy

You can program an event to maintain information on a cell(s) containing the
formula, then react when the results displayed are changed. I don't have a
list, but there are some things a function (UDF) can do. I believe it could
create a defined name for example. It could execute a query (DAO I
believe). It could create a comment. (I didn't specifically test these
before posting, but I believe these are true based on past posts in these
groups). So something like this could be used to communicate with an event.
 
E

Elliot

Nope it is a genuine user defined function. It returns a value to the
function cell and also populates cells below it. And if the function referes
to ranges that change the function re-runs. The addin must must process the
function and call some code that updates the cells.

I'd like to replicate that . I'll have to experiment with a automation addin

Thanks for the replies
 

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