Testing of procedures

  • Thread starter Thread starter GeorgeMar
  • Start date Start date
G

GeorgeMar

Why is it that you can't always Run a procedure from the
VB Editor to test it? It comes up with macro window and
the procedure that you want is not listed.

sometimes when you place the cursor in the procedure and
hit Run, it works, other times it doesn't. Is there a way
to always make it Run?

regards
george
 
A simple way to test a procedure is to open the Immediate Window (press
Ctrl+G).
Then call your function like this:
? MyFunc()
or your sub by just typing its name:
MySub

That will not work if the procedure has the word "Private" before its
declaration.

If the procedure is from a class module (such as the module of a form), you
may need to include the module name to reference the procedure, e.g.:
Form_MyForm.MyButton_Click
You see the name of the module in the title bar of the code window.
 
Back
Top