Can't Find Function from Switchboard Command

SAK

Registered User.
Local time
Today, 11:26
Joined
Jun 5, 2003
Messages
43
I converted my macros to functions, but when I try to call the funciton from the switchboard (using runcode), I get a message that says the function can't be found. I am pretty sure I named it correctly, including the () at the end of the function name.

Just learning VBA here, so need a little help to grease the wheels.

Thanks
 
Hi SAK and welcome to the site.

I don't think you'll need "runcode" to call a function but could you please post the exact line of code you are using to call it?

Regards
Chris
 
Make sure it's the Function name and not the Module name
 
Thanks for the welcome and thanks for the responses.

For sure I am calling the function not the module, so that part is covered.

In fact, the function, when called from a macro or from a procedure works.

The problem seems to be related to the built in switchboard manager, where the Run Code option is selected. I enter the function name, (that works from a macro or sub) but for some reason it jams up on the switchboard command.

Thanks in advance.
 
The macro converter does not create functions with the Public keyword. That may be why the switchboard can't see them. Change the headers to be:

Public YourFunction(...)

Or you can change the references to:
YourModuleName.YourFunction()
 

Users who are viewing this thread

Back
Top Bottom