+ Reply to Thread
Results 1 to 3 of 3

Bizarre crash when viewing UserForm in Debug

  1. #1
    Forum Contributor Rhudi's Avatar
    Join Date
    03-08-2013
    Location
    South Carolina, US
    MS-Off Ver
    Professional Plus 2016 aka Office 365
    Posts
    199

    Bizarre crash when viewing UserForm in Debug

    It will be impossible to show code for this issue as this code is all very private.

    I am hoping that describing the steps to crash will be enough for anyone to point me in the right direction.

    Here is the problem: I have a Worksheet that opens another Worksheet. That second Worksheet contain all my UserForms and common VBA code.

    Everything run perfectly. However, it will Instant crash Excel with no indication of why, if I do the following: Open main Worksheet, run code that displays UserForm (through debugger, or button click), close UserForm, try to view form in Debugger.

    If I open all related sheets, I can view the object or code, and switch between views, with no issue. Once that UserForm actually runs, any attempt to View that Object in Debug will instant-crash Excel.

    There is this Windows Event at time of crash:
    Please Login or Register  to view this content.
    I followed this link and edumactated my stoopid self:
    https://answers.microsoft.com/en-us/...b-8e9fb314bd54

    Setting the appropriate Reg Keys exposed the error. I had removed a control from the form, but the code still referred to that "control.Value". There was also another undeclared variable.

    RTFM in the extreme. I'm going to post this anyway, but mark it as Solved.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,530

    Re: Bizarre crash when viewing UserForm in Debug

    Quote Originally Posted by Rhudi View Post
    There was also another undeclared variable.
    I strongly recommend to everyone that they use Option Explicit and declare variables. Doing so prevents a lot of bugs and runtime errors.

  3. #3
    Forum Contributor Rhudi's Avatar
    Join Date
    03-08-2013
    Location
    South Carolina, US
    MS-Off Ver
    Professional Plus 2016 aka Office 365
    Posts
    199

    Re: Bizarre crash when viewing UserForm in Debug

    It was crazy that the undeclared variable didn't cause any other errors. The affected Sub wasn't even being called anymore (and should have been deleted anyway). It was just crazy how the form would load and unload with no problem, but would crash when attempting to Debug/edit the form after a run.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel Crash at Userform Launch
    By sokeefe22 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-08-2019, 09:42 AM
  2. crash on userform
    By Binder in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-30-2010, 10:42 AM
  3. Excel crash on userform show
    By bruinenat2 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-03-2009, 05:47 AM
  4. Viewing a worksheet within a Userform
    By chris_waldie in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-30-2006, 03:52 PM
  5. Userform & crash
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-01-2005, 10:06 AM
  6. Userform & crash
    By lezabour in forum Excel General
    Replies: 0
    Last Post: 03-01-2005, 06:46 AM
  7. [SOLVED] UserForm Viewing
    By Diane Alsing in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-11-2005, 12:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1