The only way that I've able to run a module is by clicking the RUN button. If I try to run the module from another module, the code is displayed on the screen, but, it does not execute. What does it take to make it run automatically.
A module is essentially a container for functions and subroutines. If a module contains one or more functions/subroutines that are public (i.e. Public Function abc()) then you can call them:
This is a long dead thread , but I am desperate about finding a way to run a module (just one subroutine ) from a Macro. I tried all sort of variations on your suggestions, but every time I run into a message that the function does not exist. But there is no function , it is just one public Sub in the VBA code. Where should I make the call from the macro ...............??? T. Blom
Information analyst
tbl@shimano-eu.com
Well, I don't generally use macros, but if my memory serves me correctly you can NOT run a subroutine from a macro. Change the subroutine to a function and give it a try. I believe a macros exists called RunCode. Just remember that any other normal calls to the subroutine would be affected by this modification so check it out by opening the module (you need to do this to make the change anyway) and compiling it.
e.g. Change "Public Sub RoutineName" to "Public Function RoutineName".
-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.