+ Reply to Thread
Results 1 to 6 of 6

UserForm Error - Exception Occurred

  1. #1
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    UserForm Error - Exception Occurred

    When I open the userform and click on the markup spin button before selecting a customer, I get an "Exception Occurred" error. How do I default to Customer1 when I open the userform without selecting it? I have attached a sample file.
    Thank you in advance
    Attached Files Attached Files
    Last edited by Aland2929; 10-02-2011 at 11:27 AM.

  2. #2
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Re: UserForm Error - Exception Occurred

    On my original workbook, I have to close the userform and then re-open it before the spin button works with the userform displayed?
    Thanks in advance

  3. #3
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Re: UserForm Error - Exception Occurred

    Hi Aland2929. Add this to your form code
    Please Login or Register  to view this content.
    -Greg If this is helpful, pls click Star icon in lower left corner

  4. #4
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Re: UserForm Error - Exception Occurred

    Thanks for your response. That code selects the first customer name and works perfectly on the test file but when I open the userform for the first time on my actual file, I can't click the spin button until I close the userform and re-open it. Then it works fine? Any ideas why this happens?
    Thanks.

  5. #5
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Re: UserForm Error - Exception Occurred

    You need to set your form's ShowModal property to False.

  6. #6
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Re: UserForm Error - Exception Occurred

    I found the problem. I updated the code for the userform but did not update the code for the specific sheet - Worksheet_Activate().
    Thank you very much for your help. It works perfectly now.

+ 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