+ Reply to Thread
Results 1 to 6 of 6

vba excel - msg box upon userform closing

  1. #1
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    vba excel - msg box upon userform closing

    Why isn't this working? Arrgh. I'm baffled. From all the examples I've researched, this should work. Every time the sub is executed, it isn't checking to see if the listbox is empty! I've tried ElseIf and even blocked out the Else statement and the form just closes without prompting a msg box. This seems pretty straight forward. The listbox control name is correct.
    Please Login or Register  to view this content.
    Much thanks in advance!
    Last edited by terriertrip; 10-02-2017 at 04:27 PM.

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: vba excel - msg box upon userform closing

    Can you attach a dummy workbook with the forms and code in it?
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Re: vba excel - msg box upon userform closing

    wb attached
    Attached Files Attached Files

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: vba excel - msg box upon userform closing

    It has to do with your FillService routine. It "loads" the ListBox even though nothing shows in it. When I remove the FillService code, the cmdClose_Click routine works as it should

  5. #5
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Re: vba excel - msg box upon userform closing

    I addressed the form initialization. It seems to work now.
    Please Login or Register  to view this content.
    Thanks for the insight gmr4evr1.

  6. #6
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: vba excel - msg box upon userform closing

    No problem. I'm glad you were able to get it working.
    Thanks for the rep.

+ 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. [SOLVED] Closing Excel via a Userform
    By Scoobster_doo in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 04-24-2017, 11:27 AM
  2. Workbook Crashes Upon Closing Userform (Userform Updates Pivot Table Source Data)
    By ChrisHook in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-20-2017, 10:28 AM
  3. VBA Project not closing after closing Excel file
    By GOGGS in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-29-2016, 10:26 AM
  4. [SOLVED] Excel takes forever to react again after closing userform
    By Mathijs3 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-20-2016, 08:09 AM
  5. Excel VBA - Closing calendar in userform incorrectly inserts date in the textbox
    By pi_tiger in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-01-2015, 06:40 PM
  6. Excel 2013 not closing after closing workbook
    By SBennett212 in forum Excel General
    Replies: 4
    Last Post: 04-04-2015, 11:07 AM
  7. Keep Modal UserForm Alive after closing 2nd userform using 2007?
    By ShredDude in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2008, 03:12 PM

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