Results 1 to 9 of 9
  1. #1
    Lounger
    Join Date
    May 2014
    Posts
    45
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Debugger doesn't take control after unhandled exception

    Hi,

    I've been working on an app in Excel for a while. One day, I suddenly discovered that errors are no longer being caught by the debugger; I simply get an unhelpful error 400, and the app terminates instead of the debugger highlighting the line in question. This has made debugging a total PITA, since I now need to set breakpoints on every line of code in order to find the one which is failing. Can anyone tell me how to re-enable normal debugging?

    --Scott.

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Scott,

    Welcome to the Lounge as a New Poster!

    You don't mention what version of Excel you are using however if you are using 2007+ and have the SpreadSheet Assistant add-in installed see this. HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    Lounger
    Join Date
    May 2014
    Posts
    45
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Sorry, Office 2013 on Windows 8.1. It appears to follow the system, not the file, since a co-worker was able to send me a screenshot of an error with the error line highlighted. Will check later to see if I have that add-in.

    I'm not new, just haven't been on in a while, and I haven't been in the VBA group before.

    --Scott.

  4. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Scott,

    Sorry, I go by the Posts count. You must have setup a new account?
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  5. #5
    Lounger
    Join Date
    May 2014
    Posts
    45
    Thanks
    0
    Thanked 2 Times in 2 Posts
    I have Office Professional Plus 2013. The add-ons are all standard -- and none are enabled. I did a repair of Office, system restore back to the 14th, and uninstalled Adobe Flash (it was recently updated), none of which helped.

    Apparently I did create a new account; I last used the old account Dec 2009.

  6. #6
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Quote Originally Posted by Scott McNay View Post
    I now need to set breakpoints on every line of code in order to find the one which is failing. Can anyone tell me how to re-enable normal debugging?
    Scott,

    You know you can set a break point at the start of a routine and then step through it with the F8 key one line at a time vs setting breakpoints on every line. HTH

    BTW: Is it possible for you to post your worksheet so we can have a look?
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  7. #7
    Lounger
    Join Date
    May 2014
    Posts
    45
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by RetiredGeek View Post
    Scott,

    You know you can set a break point at the start of a routine and then step through it with the F8 key one line at a time vs setting breakpoints on every line. HTH
    It's frustrating when you hit F8 when you meant to hit F5 ("eek, not the rabbit hole, I don't remember where I was!"), and vice versa.

    Quote Originally Posted by RetiredGeek View Post
    BTW: Is it possible for you to post your worksheet so we can have a look?
    I found a workaround, but would like to know what the problem is. As I mentioned earlier, the problem follows the computer, not the worksheet, so it'll probably work fine for you.

    I just remembered, it broke around the time the buttons in my app quit working suddenly, and I had to replace all of them; none of them had a macro option anymore.

    --Scott.

    No_Debug.xlsm

  8. #8
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Scott,
    I just remembered, it broke around the time the buttons in my app quit working suddenly, and I had to replace all of them; none of them had a macro option anymore.
    Have you read this thread?

    You are correct it worked properly on my Win 8.1 Update 1 64 Bit Office 2010 32 bit Excel.
    scottmacro.JPG
    Interesting though it returned error 1004 not a 400!

    HTH
    Last edited by RetiredGeek; 2015-01-03 at 07:38.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  9. #9
    Lounger
    Join Date
    May 2014
    Posts
    45
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Yes, 1004 is what it should have given, as you can see from the MsgBox if you run Macro1. It's Macro2 and Macro3 which give wrong results.

    I didn't see either of the updates mentioned in the article, so I uninstalled updates installed on Nov 30th and Nov 16th, restarted, tested, then uninstalled updates installed on Nov 15th (a lot of them), restarted, tested, then discovered that Windows had reinstalled all of them behind my back; I guess I should have disconnected network. So, thoroughly tired of that (It took maybe an hour to uninstall all of those updates), I checked to be sure I had media and key, uninstalled Office, restarted, reinstalled Office, tested, and... it failed again. :-(

    At least I have the Macro1 workaround for now, and I can try this again later, removing updates back to before Nov 1, and/or uninstalling again followed by MSI cleanup tool and ccleaner. Actually, I guess I should do both, uninstalling Office, removing any remaining Office and Windows updates, and cleanup.

    --Scott.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •