0

I am trying to make my first vbscript, but it is a bit complicated. I know some VBA but totally new to vb. In my script, I currently have some sub () and function () routines. How would I get the script to start, so the main sub () can run and make the necessary calls?

If you could advise or point me to a site that may be better suited to novice queries, I would appreciate it.

Glib
  • 11

1 Answers1

2

You didn't mention the context in which you're using vbscript. I'll assume you're using it for scripting with the WSH.

If you had the main logic in a sub called mysub(), you'd normally just place a call to it at the top of your script:

mysub

Sub mysub ()
...
End Sub

And of course, you have to run the script. From memory, I think that would be cscript myscript.vbs from the command prompt.

To learn more about VBScript, have a look at MS TechNet's Sesame Script series of tutorials. There's one specifically on functions and subroutines here. To get help, you could try the TechNet forums.

pyrocrasty
  • 1,452
  • Thanks for that - sorted me out. Took a little while to test, but I think all is well. Many thanks! – Glib May 25 '15 at 16:56