The Object invoked has disconnected from its clients

30percent

Board Regular
Joined
May 5, 2011
Messages
116
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I have the following code. When I run it I got the following error message at this line: Set c1 = Rng.Find("item_1", LookIn:=xlValues).

Run-time error
Automation error
The Object invoked has disconnected from its clients


Wonder if someone could point to me how I could fix the error or point out what's wrong. Thank you!

Code:
Sub status_And_check()


Dim get_Row As Object
Set get_Row = CreateObject("Scripting.Dictionary")
Set get_Row = Q_check()


Debug.Print get_Row.Item("item_1")


End Sub


Function Q_check()
    Dim check_Dict As Object
    Set check_Dict = CreateObject("Scripting.Dictionary")


    Set Rng = ThisWorkbook.Worksheets("sheet1").Range("B:B")
    
    Set c1 = Rng.Find("item_1", LookIn:=xlValues)
    If Not c1 Is Nothing Then
        check_Dict.Add "item1", c1.Row
    End If
    
    Set c2 = Rng.Find("item_2", LookIn:=xlValues)
    
    If Not c2l Is Nothing Then
        check_Dict.Add "item_2", c2.Row
    End If


          
Set Q_check() = check_Dict
End Function
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,213,490
Messages
6,113,957
Members
448,535
Latest member
alrossman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top