+ Reply to Thread
Results 1 to 7 of 7

Userform vbmodeless

  1. #1
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Userform vbmodeless

    Running a workbook that is a add-in, if I make the add-in userform vbmodeless the workbook won't close?
    Please Login or Register  to view this content.
    Do I need to add something to add-in workbook before close event?
    Thanks

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Userform vbmodeless

    Good afternoon zplugger

    You can't close a workbook and leave a userform open.
    Is it the add-in you are trying to close? If so, it sounds like you haven't set your ThisWorkbook object property "IsAddIn" to True.

    HTH

    DominicB

  3. #3
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Userform vbmodeless

    Thanks dominib
    if I add a command button to userform to close it it works UnLoad Me, but if I close the userform with red X I get problems. How can I make the red X act the same way as a Commandbutton?
    Please Login or Register  to view this content.

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Userform vbmodeless

    Hi zpliugger
    Quote Originally Posted by zplugger View Post
    if I make the add-in userform vbmodeless the workbook won't close?
    The workbook won't close or the userform won't close?
    What kind of problems do you get?

    DominicB

  5. #5
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Userform vbmodeless

    The blank workbook wont close if I open the add-in workbook. If I close the add-in workbook with the commandbutton all is OK,but if I
    close the add-in with the red x on the userform the blank workbook does not close. Just get a little blue circle turning.

  6. #6
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Userform vbmodeless

    Hi zplugger

    I have never had any issues closing a userform, modeless or otherwise.
    I admit to being a little perplexed about why you are using a UserForm_QueryClose sub. I normally find that the little red X tidies up very nicely after itself and doesn't need any help - I would only use this structure if I wanted to intercept before the form closes, for example to give a message, or even stop the user from closing with the red X. What happens if you omit this routine?

    DominicB

  7. #7
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Userform vbmodeless

    Same problem with omited. dominicb this only happens when running as a Excel Add-In.No problem when its a normal workbook.

+ 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. userform not showing text when run vbModeless
    By Sliman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2017, 05:36 PM
  2. How does the "vbModeless" in "UserForm.show vbModeless" work?
    By aijp in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-13-2013, 07:43 PM
  3. [SOLVED] Disable buttons in custom ribbon before opening a vbModeless UserForm
    By heapifyman in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 01-14-2013, 12:38 PM
  4. Running code while displaying a UserForm with vbModeless
    By PilgrimTim in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-06-2007, 08:08 AM
  5. Help with vbModeless
    By systematic in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-18-2005, 07:35 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