+ Reply to Thread
Results 1 to 15 of 15

Userform doesnt work suddenly

  1. #1
    Registered User
    Join Date
    10-02-2021
    Location
    HK
    MS-Off Ver
    2010
    Posts
    16

    Userform doesnt work suddenly

    The situation is that I have a userform1 namely "accounts". Within it, I have a button"A" to trigger another userform2 namely "account selection".
    In the userform2, I have the "accountok" button to trigger the following code. Previously, when I click the "accountok", I will only unload my userform2. But under the
    situation I didnt change the code, some problems happen. When I am opening the Visual Basic Window, I click the "accountok" button, it will directly close my second and first userform at the same time(i.e
    close all things). But if I close the Visual Basic Window, the code functions properly. (Although I dont think it is related to my code below) Anyone can help? Please


    Please Login or Register  to view this content.
    Last edited by jasonxlui; 10-07-2021 at 10:32 AM.

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,313

    Re: Userform doesnt work suddenly

    see big yellow banner - upload your workbook
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Registered User
    Join Date
    10-02-2021
    Location
    HK
    MS-Off Ver
    2010
    Posts
    16

    Re: Userform doesnt work suddenly

    Now uploaded my excel file. I repeat my problems again.
    Now, when I am opening the Visual Basic window, I click the "Placing Orders" button → click the "select" button" → Randomly click any account and then click "OK"
    it will close all my userforms.

    But if I close my Visual Basic window and then perform the same actions, my first userform still remains here and only the second userform will be closed.
    Thank you all.
    Attached Files Attached Files

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Userform doesnt work suddenly

    Hi jasonxlui,

    you would need to include an information about having posted the same request at least at one other forum https://www.mrexcel.com/board/thread...denly.1183546/. As I´m not so sure that you can do so I´ve added this link.

    And maybe even edit the opening post and wrap the code with code-tags?
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  5. #5
    Registered User
    Join Date
    10-02-2021
    Location
    HK
    MS-Off Ver
    2010
    Posts
    16

    Re: Userform doesnt work suddenly

    Yes, i cant add the link, even quoting your reply including the link.
    Besides, I added the code tag, thanks.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: Userform doesnt work suddenly

    @jasonxlui

    It would appear from the TWO mistakes you have made already that you need to read this forum's simple rules. Please do this BEFORE posting again.

    Here is a direct link to them for your benefit: https://www.excelforum.com/forum-rul...rum-rules.html

    Thank you.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,313

    Re: Userform doesnt work suddenly

    @jasonxlui, I can not replicate your described error -

  8. #8
    Registered User
    Join Date
    10-02-2021
    Location
    HK
    MS-Off Ver
    2010
    Posts
    16

    Re: Userform doesnt work suddenly

    Quote Originally Posted by torachan View Post
    I can not replicate your described error -
    Sorry, dont know why no error in this file. I reuploaded a new one. Many thanks.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-02-2021
    Location
    HK
    MS-Off Ver
    2010
    Posts
    16

    Re: Userform doesnt work suddenly

    I will follow the rule next time. Sorry and thanks.

  10. #10
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,242

    Re: Userform doesnt work suddenly

    In the Accountform Properties, set ShowModal to True

    Artik

  11. #11
    Registered User
    Join Date
    10-02-2021
    Location
    HK
    MS-Off Ver
    2010
    Posts
    16

    Re: Userform doesnt work suddenly

    Sorry, it is not the error I mean and I want to remain the Showmodal to be false.

  12. #12
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,313

    Re: Userform doesnt work suddenly

    Sorry, it is not the error I mean and I want to remain the Showmodal to be false.
    Why ?????????

  13. #13
    Registered User
    Join Date
    10-02-2021
    Location
    HK
    MS-Off Ver
    2010
    Posts
    16

    Re: Userform doesnt work suddenly

    Quote Originally Posted by torachan View Post
    Why ?????????
    That sentence is used to reply artik.

    My error still here.

    Situation1:
    when I am opening the Visual Basic window, I click the "Placing Orders" button → click the "select" button" → Randomly click any account and then click "OK"
    it will close all my userforms.

    Situation2:
    If I am not opening the Visual Basic window, I click the "Placing Orders" button → click the "select" button" → Randomly click any account and then click "OK"
    it will not close my userform namely "Placing Orders" in the top left corner. (And I want to remain it open)

    So, I think it is not related to the showmodal, right? (I remember previously I also set the show modal to be "False", my "Placing Orders" still will not be closed even I am doing the things situation 1 .

  14. #14
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,242

    Re: Userform doesnt work suddenly

    jasonxlui, did you do what I said (ShowModal = True)?
    If not, then do it. Then run the form, choose something from the accountselection window. Has the accountform disappeared? He stayed open with me. After this test, I re-set ShowModal = False in the accountform. From now on, your problem does not occur, whether the VBE is open or not.

    There seems to be some garbage in the project that was interfering with proper operation.

    Artik

  15. #15
    Registered User
    Join Date
    10-02-2021
    Location
    HK
    MS-Off Ver
    2010
    Posts
    16

    Re: Userform doesnt work suddenly

    Quote Originally Posted by Artik View Post
    jasonxlui, did you do what I said (ShowModal = True)?
    If not, then do it. Then run the form, choose something from the accountselection window. Has the accountform disappeared? He stayed open with me. After this test, I re-set ShowModal = False in the accountform. From now on, your problem does not occur, whether the VBE is open or not.

    There seems to be some garbage in the project that was interfering with proper operation.

    Artik

    yes, did it but didnt know repeat one more time can make it normal.
    Now it is solved. Many thinks!!

+ 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. Suddenly VBA to run ftp command not work.
    By karmapala in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-04-2021, 11:39 AM
  2. Hid Workbook/Sheet, Now Userform Doesnt Work. Workbook Greyed Out.
    By davis909 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-12-2016, 10:12 AM
  3. autotab doesnt work on userform first open
    By ramzter in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-06-2014, 08:07 PM
  4. Get Data from UserForm (TextBox, ListBox) doesnt work
    By BorisMKD in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-15-2014, 05:07 AM
  5. How can AutoFilter suddenly not work?
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2011, 08:58 AM
  6. Button suddenly does not work
    By Man Utd in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 10-20-2005, 02:05 AM
  7. [SOLVED] beep suddenly won't work
    By Jack Sons in forum Excel General
    Replies: 3
    Last Post: 08-14-2005, 10:05 AM

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