Running functions

D

Dave Neve

Hi

The macro below is apparently recursive and can cause
a computer to run out of memory. But how do you run
it as it doesn't seem to execute from VBA Editor and the macro doesn't
appear in VBA explorer.

Does a function have to be called from another sub or something?

Thanks

_____________________________________

Function

RunOut(Maximum)
RunOut = RunOut(Maximum)

End Function

_______________________________
 
M

Malcolm Smith

Dave

If you mean the list of available 'macros' within Word that's because
there is no possibility of entering a parameter when once runs a routine
from there, so nothing with an argument list is visible.

Secondly, a function returns something. And in that dropdown list there
is no ability to handle that returned value. So, they are rightly dropped
from the list.

Lastly, anything whose scope is not applicable (a private routine, for
example) won't be in the list either.


As for the computer to run out of memory; of course it will. It will
gobble up all the available stack space as it goes around and around for
ever...

- Malc
 

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