Execution Error

Discussion in 'AutoCAD' started by tsigwing, Apr 26, 2004.

  1. tsigwing

    tsigwing Guest

    I've got a VBA app that runs great for me. It is on the network for all of our users to use. Sometimes they will get an "execution error" when begining this routine. I have searched through the newsgroup for answers but found none. I have no End statements to end the app, just unload.me. Any other ideas?

    This doesn't happen all of the time, just some of the time and is really frustrating.
     
    tsigwing, Apr 26, 2004
    #1
  2. tsigwing

    Kevin Terry Guest

    every now and then we get that here, I've never nailed it down to a
    repeatable cause but here's our fix:

    appload, ok

    sounds weird, but just running that command seems to run some kind of check
    to make sure anything which should be loaded actually is (our main program
    dvb file is in the start up suite)

    HTH,
    Kevin

    of our users to use. Sometimes they will get an "execution error" when
    begining this routine. I have searched through the newsgroup for answers
    but found none. I have no End statements to end the app, just unload.me.
    Any other ideas?
    frustrating.
     
    Kevin Terry, Apr 26, 2004
    #2
  3. tsigwing

    oreois Guest

    Any idea why the following causes an automation error:

    Public Sub Start()
    frmDrawingSetUp.Show
    End Sub

    All it does is launch a user form. Nothing complicated or mysterious.


    of our users to use. Sometimes they will get an "execution error" when
    begining this routine. I have searched through the newsgroup for answers
    but found none. I have no End statements to end the app, just unload.me.
    Any other ideas?
    frustrating.
     
    oreois, Apr 27, 2004
    #3
  4. tsigwing

    Ed Jobe Guest

    If a sub in the form has an unhandled error, then it bubbles up to the calling sub. Set a breakpoint and step through the code to find the unhandled error.

    --
    ----
    Ed
    ----
    Any idea why the following causes an automation error:

    Public Sub Start()
    frmDrawingSetUp.Show
    End Sub

    All it does is launch a user form. Nothing complicated or mysterious.


    of our users to use. Sometimes they will get an "execution error" when
    begining this routine. I have searched through the newsgroup for answers
    but found none. I have no End statements to end the app, just unload.me.
    Any other ideas?
    frustrating.
     
    Ed Jobe, Apr 27, 2004
    #4
  5. tsigwing

    oreois Guest

    It doesn't get that far. If I step through I immediately get the error on the first line Public Sub Start()
    If a sub in the form has an unhandled error, then it bubbles up to the calling sub. Set a breakpoint and step through the code to find the unhandled error.

    --
    ----
    Ed
    ----
    Any idea why the following causes an automation error:

    Public Sub Start()
    frmDrawingSetUp.Show
    End Sub

    All it does is launch a user form. Nothing complicated or mysterious.


    of our users to use. Sometimes they will get an "execution error" when
    begining this routine. I have searched through the newsgroup for answers
    but found none. I have no End statements to end the app, just unload.me.
    Any other ideas?
    frustrating.
     
    oreois, Apr 27, 2004
    #5
  6. tsigwing

    Ed Jobe Guest

    Are you using Step Into or Step Over? You should be using Step Into. Does the project compile? Debug>Compile. Is the form name spelled right? Is it recognized by vba? If so you should be able to delete .Show and retype the period and Intellisense would display the props/methods. These are a few of the tests you could perform.

    --
    ----
    Ed
    ----
    It doesn't get that far. If I step through I immediately get the error on the first line Public Sub Start()
    If a sub in the form has an unhandled error, then it bubbles up to the calling sub. Set a breakpoint and step through the code to find the unhandled error.

    --
    ----
    Ed
    ----
    Any idea why the following causes an automation error:

    Public Sub Start()
    frmDrawingSetUp.Show
    End Sub

    All it does is launch a user form. Nothing complicated or mysterious.


    of our users to use. Sometimes they will get an "execution error" when
    begining this routine. I have searched through the newsgroup for answers
    but found none. I have no End statements to end the app, just unload.me.
    Any other ideas?
    frustrating.
     
    Ed Jobe, Apr 27, 2004
    #6
  7. tsigwing

    oreois Guest

    Most of the time it works fine. I never get this error, sometimes other users get this error. It is located on a network server that only I have write permissions to. It really is annoying.
    Are you using Step Into or Step Over? You should be using Step Into. Does the project compile? Debug>Compile. Is the form name spelled right? Is it recognized by vba? If so you should be able to delete .Show and retype the period and Intellisense would display the props/methods. These are a few of the tests you could perform.

    --
    ----
    Ed
    ----
    It doesn't get that far. If I step through I immediately get the error on the first line Public Sub Start()
    If a sub in the form has an unhandled error, then it bubbles up to the calling sub. Set a breakpoint and step through the code to find the unhandled error.

    --
    ----
    Ed
    ----
    Any idea why the following causes an automation error:

    Public Sub Start()
    frmDrawingSetUp.Show
    End Sub

    All it does is launch a user form. Nothing complicated or mysterious.


    of our users to use. Sometimes they will get an "execution error" when
    begining this routine. I have searched through the newsgroup for answers
    but found none. I have no End statements to end the app, just unload.me.
    Any other ideas?
    frustrating.
     
    oreois, Apr 28, 2004
    #7
  8. tsigwing

    Ed Jobe Guest

    Then you need to go to your form and add error handling so that the form handles the error and you don't get a big ? when the error bubbles back up to the calling sub. Below is a sample sub with typical error handling. Note how I use the title argument of the MsgBox function to provide information as to the source of the error.

    Sub HandleErrorTest()
    On Error GoTo Err_Control

    'do your stuff here
    'If my code wants to trap an application specific error,
    'I will raise an error here with:
    'Err.Raise vbObjectError, "HandleErrorTest", "Application Specific Error"

    Exit_Here:
    Exit Sub
    Err_Control:
    Select Case Err.Number
    'Add your Case selections here
    Case Is = vbObjectError + 1000
    MsgBox Err.Number & ", " & Err.Description, , Err.Source
    Resume Exit_Here
    Case Else
    MsgBox Err.Number & ", " & Err.Description, , "HandleErrorTest"
    Err.Clear
    Resume Exit_Here
    End Select
    End Sub

    --
    ----
    Ed
    ----
    Most of the time it works fine. I never get this error, sometimes other users get this error. It is located on a network server that only I have write permissions to. It really is annoying.
    Are you using Step Into or Step Over? You should be using Step Into. Does the project compile? Debug>Compile. Is the form name spelled right? Is it recognized by vba? If so you should be able to delete .Show and retype the period and Intellisense would display the props/methods. These are a few of the tests you could perform.

    --
    ----
    Ed
    ----
    It doesn't get that far. If I step through I immediately get the error on the first line Public Sub Start()
    If a sub in the form has an unhandled error, then it bubbles up to the calling sub. Set a breakpoint and step through the code to find the unhandled error.

    --
    ----
    Ed
    ----
    Any idea why the following causes an automation error:

    Public Sub Start()
    frmDrawingSetUp.Show
    End Sub

    All it does is launch a user form. Nothing complicated or mysterious.


    of our users to use. Sometimes they will get an "execution error" when
    begining this routine. I have searched through the newsgroup for answers
    but found none. I have no End statements to end the app, just unload.me.
    Any other ideas?
    frustrating.
     
    Ed Jobe, Apr 28, 2004
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.