title: "Automation Error: Object Invoked has disconnected from its clients"
body: <p>I figured out what Nick was suggesting, and the following is the error number &amp; description that I'm getting:</p>
  <blockquote>
  <p>'-2147417848 (80010108)' Automation error The object invoked has
  disconnected from its clients</p>
  </blockquote>
  <p>The line of code that is highlighted when I debug is:</p>
  <pre><code>.Rows(Lst).Insert Shift:=xlDown
  </code></pre>
  <p>I thought that I had seen somewhere on this or another forum to unregister then re-register a specific file, but I was at home when I came across that, and didn't want to try it on my laptop, since everything already works 100% on it.</p>
  <p>Once again, any help is greatly appreciated.  I leave Sunday for 2 weeks, and I really need to get this working before I leave.  Most of the people working for me are not excel guru's and need all buttons/functions working, as they won't be able to troubleshoot and/or work around the problems.</p>
  <p>I am still sitting with the following code in a regular module, and the next set of code below that is in one of the worksheet modules.</p>
  <pre><code> Sub add_InvRow()
   Application.Calculation = xlCalculationManual
   Application.EnableEvents = False
  
   switch = &quot;off&quot;
  
   With ThisWorkbook
    Dim wb As Excel.Workbook, Lst As Long
    Set wb = Application.ThisWorkbook
  Dim ws As Worksheet, sw As Worksheet, os As Worksheet
     Set ws = ActiveSheet: Set sw = Application.Sheets(Sheet1.Name): Set os = Application.Sheets(Sheet4.Name)
  
    With ws
    Lst = ActiveCell.Row
    End With
   
     If ws.CodeName = &quot;Sheet3&quot; Then
   
    With os
     .Rows(213).Copy
    End With
  
    With ws
   
  
     .Rows(Lst).Insert Shift:=xlDown
     Application.CutCopyMode = False
       
      venTabForm.Show
    End With
  End If
  
  If ws.CodeName = &quot;Sheet23&quot; Then
   
    With sw
     .Rows(135).Copy
    End With
  
    With ws
    
     .Rows(Lst).Insert Shift:=xlDown
     Application.CutCopyMode = False
       
      cItemForm.Show
    End With
  End If
   
   If ws.CodeName = &quot;Sheet25&quot; Then
   
   With sw
     .Rows(105).Copy
    End With
  
    With ws
     
     .Rows(Lst).Insert Shift:=xlDown
     Application.CutCopyMode = False
       
     coInvForm.Show
    End With
   End If
   
   If ws.CodeName = &quot;Sheet28&quot; Then
        
    With sw
     .Rows(100).Copy
    End With
    
    With ws
     
     .Rows(Lst).Insert Shift:=xlDown
     Application.CutCopyMode = False
       
     kInvForm.Show
    End With
  End If
  
  If ws.CodeName = &quot;Sheet27&quot; Then
    
    With sw
     .Rows(130).Copy
    End With
    
    With ws
       .Rows(Lst).Insert Shift:=xlDown
       Application.CutCopyMode = False
       
       ItemForm.Show
    End With
  End If
   
  If ws.CodeName = &quot;Sheet22&quot; Then
    
    With sw
     .Rows(120).Copy
    End With
  
    With ws
     
     .Rows(Lst).Insert Shift:=xlDown
     Application.CutCopyMode = False
       
      caInvForm.Show
    End With
  End If
   
   Set ws = Nothing: Set sw = Nothing: Set os = Nothing: Set wb = Nothing
  End With
  
   switch = &quot;on&quot;
   Application.EnableEvents = True
   Application.Calculation = xlCalculationAutomatic
  End Sub
    
    
  </code></pre>
  <p>This code is on one of the worksheets that has a command button, which calls the above code.</p>
  <pre><code> Private Sub Worksheet_Change(ByVal Target As Range)
  If Target.Cells.Count &gt; 1 Then Exit Sub
  If switch = &quot;off&quot; Then Exit Sub
   If Target.Address = &quot;$H$1&quot; Then
    Call findItem
   Exit Sub
   End If
  
  
  If Application.Intersect(Target, Me.Range(&quot;P:P&quot;)) Is Nothing Or Target.Cells.Count &gt; 1 Then Exit Sub
  If Target.Cells.Value = 0 Or Target.Cells.Value = &quot;&quot; Then Exit Sub
  Dim wb As Workbook, ws As Worksheet, iNUM As String, kitSHT As Worksheet, ksRNG As Range, kITEM As Range, kbCELL As Range
  Dim iNAME As String, catSHT As Worksheet, csRNG As Range, cbCELL As Range, cITEM As Range
  Dim logCELL As Range
  
  
  
  Set wb = ThisWorkbook: Set ws = wb.Sheets(Sheet27.Name): Set kitSHT = wb.Sheets(Sheet28.Name): Set catSHT = wb.Sheets(Sheet22.Name)
  Set ksRNG = kitSHT.Range(&quot;C5:C1100&quot;): Set kbCELL = ksRNG.Cells(5, 3)
  Set csRNG = catSHT.Range(&quot;C6:C400&quot;): Set cbCELL = csRNG.Cells(6, 3)
  
  
   If (Not (Application.Intersect(Target, Me.Range(&quot;A:P&quot;)) Is Nothing)) And (Target.Cells.Count = 1) And (Target.Column = 16) Then
    If Target.Value = 0 Then Exit Sub
     iNUM = Target.Offset(, -12).Value
     iNAME = Target.Offset(, -10).Value
  
     If kitSHT.Cells.Find(What:=iNUM, After:=kbCELL, LookIn:=xlValues, LookAt:= _
  xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False) Is Nothing And _
    catSHT.Cells.Find(What:=iNUM, After:=cbCELL, LookIn:=xlValues, LookAt:= _
  xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False) Is Nothing Then
  
  
  
      MsgBox iNUM &amp; &quot;-&quot; &amp; iNAME &amp; &quot;&quot; &amp; &quot; is not currently listed on&quot; &amp; &quot; &quot; &amp; kitSHT.Name &amp; &quot; &quot; &amp; &quot;or&quot; &amp; &quot; &quot; &amp; catSHT.Name &amp; vbNewLine &amp; vbNewLine &amp; _
                &quot;Please add&quot; &amp; &quot; &quot; &amp; iNUM &amp; &quot;-&quot; &amp; iNAME &amp; &quot;&quot; &amp; &quot; to&quot; &amp; &quot; &quot; &amp; kitSHT.Name &amp; &quot; &quot; &amp; _
                 &quot;or&quot; &amp; &quot; &quot; &amp; catSHT.Name &amp; &quot; &quot; &amp; &quot;and corresponding count sheets&quot;, vbInformation
                 
    Set wb = Nothing: Set ws = Nothing: Set kbCELL = Nothing
    Set ksRNG = Nothing: Set kitSHT = Nothing: Set cbCELL = Nothing: Set catSHT = Nothing: Set csRNG = Nothing
    Exit Sub
   Else
  If Target.Value = 0 Then Exit Sub
    premNUM = iNUM
  
  
   pFORM.Show
   End If
   End If
  
    Set wb = Nothing: Set ws = Nothing: Set kbCELL = Nothing
    Set ksRNG = Nothing: Set kitSHT = Nothing: Set cbCELL = Nothing: Set catSHT = Nothing: Set csRNG = Nothing
  
  
    Set ksRNG = Nothing: Set kitSHT = Nothing: Set cbCELL = Nothing: Set catSHT = Nothing: Set csRNG = Nothing
  End Sub
  
  
  
  
   
  </code></pre>