View Single Post
 
Old 02-21-2018, 03:41 PM
Cosmo Cosmo is offline Windows Vista Office 2007
Competent Performer
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default Callback to function in a module

I have created a class to manage a series of UserForms to collect data, and in that class I have it passing a callback to each user form using "CallByName", which refers to a function in the class to open the next dialog. That seems to be working properly.

Now I need the control class to pass a callback to a function in the main Module (not a class) to process the data, but I can't use "CallByName" since that requires an object, not a module.

I think I may need to use AddressOf, but I'm not sure if I'm doing this correctly.

Can somebody help me to pass a function as a parameter from the module to the class, and to call that function from the class. In my control class, I want a function such as:
Code:
function setCallbackFunction (moduleFunctionToProcessData){
     ' Set a property in the class to hold reference to function in module
}
so that I can call it, with parameters and return value:
Code:
myResult = moduleFunctionToProcessData(arg1, arg2, arg3)
Thank you.
Reply With Quote