+ Reply to Thread
Results 1 to 16 of 16

-2147417848 automation error the object invoked has disconnected from its clients

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-11-2010
    Location
    India
    MS-Off Ver
    2010
    Posts
    268

    Re: -2147417848 automation error the object invoked has disconnected from its clients

    Biggest module is 5547 lines of code (about 500-1000 of that will be commented code). And a sheet has about 600 lines of code. Two other sheets have less than 50 lines each.

    Biggest module is 279KB when exported as a bas file.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: -2147417848 automation error the object invoked has disconnected from its clients

    Think you need to chop it up; 64K is the upper limit, but I'd expect (don't know for sure) that that's for code, not comments.

    Meanwhile, do you indeed have Option Explicit at the top of all used modules?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    03-11-2010
    Location
    India
    MS-Off Ver
    2010
    Posts
    268

    Re: -2147417848 automation error the object invoked has disconnected from its clients

    Hi

    I chopped up my module into 4 such that the biggest bas file is 61k.

    I re-checked that I have Option Explicit at the top of all used modules.

    But this still didn't help.

    I have got following code in "ThisWorkbook". Could this be a problem, since the issue comes only when I move away from this file, to another file, while macro is running?
    I commented this, but the problem persists.

    Option Explicit
    
    Private Sub Workbook_Activate()
    On Error GoTo ErrHandler
       'Disable right click when you select this workbook
       Application.CommandBars("Ply").Enabled = False  
    Exit Sub
    ErrHandler:
        MsgBox "FATAL ERROR!!!" 
        End_Prog
    End Sub
    
    Private Sub Workbook_Deactivate()
    On Error GoTo ErrHandler
       'Enable right click when you select other workbooks
       Application.CommandBars("Ply").Enabled = True
    Exit Sub
    ErrHandler:
        MsgBox "FATAL ERROR!!!" 
        End_Prog
    End Sub

+ 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