Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8908949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:18:49+00:00 2026-06-15T03:18:49+00:00

I have looked on Google and the answer is not there! First things first.

  • 0

I have looked on Google and the answer is not there!

First things first. WScript.Quit DOES NOT WORK! I have no idea what “WScript” is but it clearly has nothing to do with client side scripting for a web page. I have seen this “WScript” thing somewhere before and it just produces errors (maybe obsolete or something) so please do not suggest it…

Anyway… all I wish to do is completely stop the script in the event of a condition not being met. Obviously I don’t want “Exit Sub” because the code would then carry on running if that sub is embedded!

I am aware of the “stop” command but I am under the impression that it is only used for debugging.

Hopefully a very simple question.

UPDATE and Conclusion: Before I close this subject I will just expand a little on what I was trying to do…

I had a number of main subs that were being started by a button click. In order to make it so that I did not have to edit each individual sub I embedded a universal sub within each one that did a preliminary check.

Part of that preliminary check was to stop the program in the case of an incorrect user input. If an error was detected I wanted to halt all progress from that point on. An “exit sub” would obviously just skip the rest of that preliminary sub and the main sub would carry on executing.

In the end it was just a case of writing in an error flag (that is checked in the main subs) or incorporating the error condition operation in each main procedure. In that way you exit the main sub and the problem is solved.

It was not laziness – I just wanted to reduce the amount of code. Thank you for the responses anyway.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T03:18:50+00:00Added an answer on June 15, 2026 at 3:18 am

    You can use something like this:

    Sub MyFunc
        ----------
        My Code
        ----------
    End Sub
    
    Function Main
      On Error Resume Next
      MyFunc
      If Err.Number <> 0
      Exit Function
    End Function
    

    It’ll stop executing the code, the point it finds an exception or throws an error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have looked on google for answers but I am not satisfied. My Logic:
I have looked for the answer to this on Google and stackoverflow, but unfortunately
I have researched google and SO and can not find answer. I have looked
I have looked around on Google and StackOverflow for the answer to this question,
Have looked quite hard for this answer but having no luck. I have 3
I've already looked myself but it seems my Google-fu is not strong today. I'm
I've looked at the site of OpenERP and Google and have not found any
I have looked on google to find a way to remove text on focus
I have looked on Google, and everywhere in the forums. Just learning JavaScript, so
I have looked for solutions to this on google for what seems like an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.