+ Reply to Thread
Results 1 to 2 of 2

Userform won't open with worksheet. Causing error and force close.

  1. #1
    Registered User
    Join Date
    03-07-2011
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003, 2007, & 2010
    Posts
    52

    Userform won't open with worksheet. Causing error and force close.

    [Note: I made a mistake in the title of this thread it should say workbook not worksheet] So I have a user form called "User_Controls" and another macro that opens and locates it. When I try to call this in the Sub Workbook_Open it force closes excel. The weird thing is it only does it if I have already enabled macros for the workbook. When I change the workbook name so it prompts me to enable macros again and click "enable content" it works just fine. Any idea what could be going on here and how I could fix it? BTW I have also tried using Sub Workbook_Activate as well to launch the user form and got the same result. My code is below. Thanks for the help.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    FYI I also posted this question on the MrExcel forums here:
    http://www.mrexcel.com/forum/excel-q...ml#post3432897
    Last edited by drew.j.harrison; 03-29-2013 at 03:39 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Userform won't open with worksheet. Causing error and force close.

    Try the following code in a standard code module

    Please Login or Register  to view this content.
    And the following code in the userform module

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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