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 7074981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:07:22+00:00 2026-05-28T06:07:22+00:00

When there is an error, I want to go back to my userform and

  • 0

When there is an error, I want to go back to my userform and change the information entered on the form and re pass it into the macro and then continue from: If Len(Dir(sFilePath & newfol, vbDirectory)) = 0…

If Len(Dir(sFilePath & newfol, vbDirectory)) = 0 Then
            MkDir sFilePath & newfol & "\"
            On Error GoTo UserForm1
        Else
            MsgBox ("Folder already exists please re enter new folder name")
            'End
            UserForm1.Show
            MoveAndSave_Reports
End If

The above give me an error message: Compile error: Label not defined at “On Error GoTO UserForm1”

  • 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-05-28T06:07:22+00:00Added an answer on May 28, 2026 at 6:07 am

    When you use an “On Error GoTo” statement, you’re telling the program that when it hits an error, skip to a specific line in the current procedure. For example:

    On Error GoTo ErrorHandler
    x = 10 / 0
    msgbox "x = infinity!"
    
    ErrorHandler:
    msgbox "Cannot divide by zero"
    

    In this example, when the code hits an error (after my “On Error” statement), it will stop what it’s doing and begin executing code at the ErrorHandler label (it’s a label because of the colon at the end). Running this code, you would never see the message box saying x = infinity. Once it hits the error by trying to divide by zero, it will jump down to the ErrorHandler label and give me a message saying I can’t divide by zero.

    Chip Pearson has a good introduction to basic error handling here.

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

Sidebar

Related Questions

I want to generate the array $result_array. There is no error at the page,
I want to hide all mysql error messages without using mysql_error() . Are there
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Why is there no error issued by strict : use strict; $a = $a
When debugging in Visual Studio 2008 I get the error There is no source
When we try to create a view within a funcion we get ERROR: there
With MVC stuff when there is an error on property level, we can add
Recently I came across this error in my WCF trace: There was an error
I get an exception with the message: There is an error in XML document.
The following line of code generates the compile time error (PE19) There is no

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.