+ Reply to Thread
Results 1 to 18 of 18

!!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.show'

  1. #1
    Registered User
    Join Date
    01-15-2016
    Location
    New England
    MS-Off Ver
    2007
    Posts
    29

    !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.show'

    Hi all-

    This is my first post but I have a decent amount of vba experience.

    I have tried literally everything with this error and I cant find any solution on the internet that works. Basically, I am opening a UF from another UF button click.

    I have tried:

    Initializing UF conditions in the PrivateSub_Userform_Initialize block ( this worked when I had the same error for another UF )

    Loading the UF before it is shown

    Adding a 2 second delay after loading it

    Enable & Disabling application events during the Userform Show



    This program is really big and has 15 or so Userforms which is probably causing the error and it's too big to attach.

    Here is the code that is cause problems



    HTML Code: 
    Private Sub CommandButton_T5_Click()
    
    Application.EnableEvents = False
    
        Delete_Sheet ("EXTRA")
        Delete_Sheet ("COLOR")
        
        
        Load Userform_T2
        
        Application.wait (Now + TimeValue("00:00:02")) ' delay 2 second
    
        Userform_T2.TextBox269 = UserForm_T1.ComboBox_T1
        Userform_T2.TextBox89 = UserForm_T1.ComboBox_T2
    
        Call Extract_Limit_INFO
    
        Call Grab_Init_Color
    
        Call Init_Heirarchy_Info
    
        Call Init_Radio_Bias
        
        
        ''''''  This is the code that causes Problems ''''''''''
    
        With Userform_T2
            .MultiPage2.VALUE = 0
            .Show
        End With
        
        ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        
        
    
    Application.EnableEvents = True
    
    End Sub


    Please help, This program is great and works perfectly except for this 1 error

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    2016 Win10
    Posts
    7,142

    Re: !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.sho

    What's in userform_T2s activate sub?

  3. #3
    Registered User
    Join Date
    01-15-2016
    Location
    New England
    MS-Off Ver
    2007
    Posts
    29

    Re: !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.sho

    Initialize Sub:

    HTML Code: 
    Private Sub UserForm_T2_Initialize()
    
        Userform_T2.TextBox273.BackColor = 14196738
        Userform_T2.TextBox275.BackColor = 15395562
        Userform_T2.TextBox274.BackColor = 16777215
        Userform_T2.TextBox276.BackColor = 6750207
        Userform_T2.TextBox277.BackColor = 13434879
    
    
        Userform_T2.TextBox269 = UserForm_T1.ComboBox_T1
        Userform_T2.TextBox89 = UserForm_T1.ComboBox_T2
    
        Call Extract_Limit_INFO
    
        Call Grab_Init_Color
    
        Call Init_Heirarchy_Info
    
        Call Init_Radio_Bias
        
        Userform_T2.Repaint
        
    End Sub


    Activice Sub:

    HTML Code: 
    Private Sub UserForm_T2_Activate()
    
        Userform_T2.TextBox273.BackColor = 14196738
        Userform_T2.TextBox275.BackColor = 15395562
        Userform_T2.TextBox274.BackColor = 16777215
        Userform_T2.TextBox276.BackColor = 6750207
        Userform_T2.TextBox277.BackColor = 13434879
    
    
        Userform_T2.TextBox269 = UserForm_T1.ComboBox_T1
        Userform_T2.TextBox89 = UserForm_T1.ComboBox_T2
    
        Call Extract_Limit_INFO
    
        Call Grab_Init_Color
    
        Call Init_Heirarchy_Info
    
        Call Init_Radio_Bias
        
        Userform_T2.Repaint
        
    End Sub

    I don't fully understand the difference between userform active & initialize

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    2016 Win10
    Posts
    7,142

    Re: !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.sho

    Activate runs when the form has focus, so made visible for example, and it runs every time it is made visible. Initialize runs once when the from is loaded.

    Your problem isn't the calling code, the problem lies in the Activate Sub (as that's where the error is occuring) - without knowing what your code does it's not possible to give you any more help. In the VBE go to Tools > Options > General > Check "Break in Class Module" > Ok. Then try re-running your code - should give you a better idea

  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    2016 Win10
    Posts
    7,142

    Re: !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.sho

    Activate runs when the form has focus, so made visible for example, and it runs every time it is made visible. Initialize runs once when the from is loaded.

    Your problem isn't the calling code, the problem lies in the Activate Sub (as that's where the error is occuring) - without knowing what your code does it's not possible to give you any more help. In the VBE go to Tools > Options > General > Check "Break in Class Module" > Ok. Then try re-running your code - should give you a better idea.

    You're running the same code 3 times, is that by design?

  6. #6
    Registered User
    Join Date
    01-15-2016
    Location
    New England
    MS-Off Ver
    2007
    Posts
    29

    Re: !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.sho

    That code is initializing Userform_T2. I tried putting it in all the places were Userform_T2 is being called thinking that would fix the problem. It just sets up userform feilds and colors...


    I tried "Break in Class Module" and adding a break point in the Userform_active sub and it didn't change anything. It also didnt stop at the break point.

    Another thing about this bug is that the program runs fine when the VBA editor is open. I only have this error when I open the excel and run the macro.

  7. #7
    Registered User
    Join Date
    01-15-2016
    Location
    New England
    MS-Off Ver
    2007
    Posts
    29

    Re: !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.sho

    I have discover that the program crashes at the 'Load Userform_T2' command found in the 'CommandButton_T5_Click()' Sub.


    I used message boxes to find where exactly the program is crashing. I can't use breakpoints because the program will not crash once the vba Editor is open.


    Please Help, I'll take any suggestions.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,059

    Re: !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.sho

    If you have subs named Private Sub UserForm_T2_Initialize() and Private Sub UserForm_T2_Activate() in the second userform's module they won't be automatically triggered, you would have to call them.

    The Initialize and Activate events of all userforms look like this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  9. #9
    Registered User
    Join Date
    01-15-2016
    Location
    New England
    MS-Off Ver
    2007
    Posts
    29

    Re: !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.sho

    Yes, I fixed those errors and it didn't change anything.

    The program acts like the Userform does not exists. I tried deleting it and re-adding but it still does not work.

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,059

    Re: !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.sho

    Any chance you could upload a sample workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

  11. #11
    Registered User
    Join Date
    01-15-2016
    Location
    New England
    MS-Off Ver
    2007
    Posts
    29

    Re: !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.sho

    Alright I try deleting stuff until its small enough...

  12. #12
    Registered User
    Join Date
    01-15-2016
    Location
    New England
    MS-Off Ver
    2007
    Posts
    29

    Re: !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.sho

    Ok the program is attached. I deleted all the unnecessary modules and UF's and customer names...


    When you run the program this what should happen:

    it will crash immediately due to the Load Userform_T2 command found in the main_ module.

    If you comment out this line it will open the Dashboard.

    Click TESEC PARSER, the TESEC UF (UserForm_T1) will open.

    Click Edit or Create New TESEC Program (CommandButton_T5).

    Message Boxes will open to show where in this sub the program crashes.



    Program will not crash if the VBA editor is open. All the other buttons do not work because I deleted most of everything to get the file to fit.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    01-15-2016
    Location
    New England
    MS-Off Ver
    2007
    Posts
    29

    Re: !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.sho

    Oh FYI, This program can run the first few times. Try:

    running it saving/closing it.

    Opening/closing another excel workbook.

    Reopening it.

    Repeat

  14. #14
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,059

    Re: !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.sho

    Only just downloaded and am having a play but no crashes yet.

    Had a quick look at the code and I notice you still have this sort of thing.
    Please Login or Register  to view this content.
    That sub will not run when UserForm_T1 is loaded, it will only run if explicitly called - see post #8.

    No idea if that has anything to do with the problem(s).

  15. #15
    Registered User
    Join Date
    01-15-2016
    Location
    New England
    MS-Off Ver
    2007
    Posts
    29

    Re: !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.sho

    Yes, I probably have some of those Initialize & Active sub naming errors sprinkled around. But, all the code in those blocks is redundant anyway.

    I thought adding the code that set up Userform_T2 before it was shown in these Private sub blocks would fix the error because I had similar success when I had the same issue with Userform_T1

  16. #16
    Registered User
    Join Date
    01-15-2016
    Location
    New England
    MS-Off Ver
    2007
    Posts
    29

    Re: !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.sho

    If it is not crashing on your computer do you think if I update my excel could solve the problem?

  17. #17
    Registered User
    Join Date
    01-15-2016
    Location
    New England
    MS-Off Ver
    2007
    Posts
    29

    Re: !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.sho

    If the program doesn't crash if VBA editor has been opened is there a way to open/close the VBA editor with code?

  18. #18
    Registered User
    Join Date
    01-15-2016
    Location
    New England
    MS-Off Ver
    2007
    Posts
    29

    Re: !!! Help !!! 'object invoke has disconnected from its clients' error on 'Userform.sho

    SOLVED


    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)

Similar Threads

  1. [SOLVED] Getting Error The object involked has disconnected from its clients.
    By tballgame009 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-21-2015, 04:58 PM
  2. Automation error , the object invoked has disconnected from its clients
    By lini1985 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-21-2014, 08:55 AM
  3. Error 440 - object invoked has disconnected from its clients
    By snapfade in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-17-2013, 11:34 AM
  4. Error: The Object Invoked Has Disconnected from Its Clients
    By ks1102 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-22-2013, 02:28 AM
  5. error: the object invoked has disconnected from its clients
    By cooper1308 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-18-2009, 10:59 AM
  6. [SOLVED] Automation Error : The Object Invoked Has Disconnected From Its Clients !!
    By donna.gough@hydro.com in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-17-2005, 09:05 AM
  7. [SOLVED] Error using SaveAs (object disconnected from clients!) then XL Cra
    By Philip in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2005, 07:06 PM

Tags for this Thread

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