Executing sub from form code

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

I have a userform. On the form I have a button that's
named "cmdok". In the form's code I have this sub:

Sub cmdok_click()
Make_CSVs
End Sub

Make_CSVs is a sub in one of my modules. My code bombs
although I can run Make_CSVs by itself and it runs fine.
Can someone tell me what I'm doing wrong? Thx.
 
What does "my code bombs" mean -

Do you get a run-time error? A compler error? A crash?

Is your Make_CSV's routine started, but something interrupts?

Is your Make_CSV's sub in a regular code module (which it should be)?
 
Sorry I wasn't more specific...

I get a compile error:

"Sub or Function not defined"

Make_CSVs is in a regular code module.
 
Any chance your sub looks like:

Private Sub make_CSVs()

If yes, the drop the Private.
 
Back
Top