The object invoked has disconnected from its clients.

azizrasul

Well-known Member
Joined
Jul 7, 2003
Messages
1,304
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Does anyone know why I get the error

-2147417848: Automation error
The object invoked has disconnected from its clients.

on the line indicated in the snippet of code?

Code:
    strWorksheet = "tblComputerSystemInformation"
    strMotherBoardSerialNumber = MotherBoardSerialNumber()
    Set ws = ThisWorkbook.Sheets("tblLicences")
    
    If intLicences < 4 Then
        With ThisWorkbook.Sheets("tblLicences")
            For lngNewRow = 2 To 11
                If .Range("A" & lngNewRow) = "" Then
                    Exit For
                Else
                End If
            Next lngNewRow
            
            .Range("A" & lngNewRow) = strMotherBoardSerialNumber     'ERRORS HERE
            .Range("B" & lngNewRow) = GetBIOSSerialNumber()             
            .Range("C" & lngNewRow) = GetHardDiskSerialNumberHex1("C:\") 
            
            ThisWorkbook.Sheets(strWorksheet).Select
            
            With ActiveSheet.ListObjects(strWorksheet).Range
                .AutoFilter Field:=1, Criteria1:=strMotherBoardSerialNumber
                .AutoFilter Field:=2, Criteria1:="Processor"
                .AutoFilter Field:=3, Criteria1:="ProcessorId"
            End With
        
            With Worksheets(strWorksheet).AutoFilter.Range
                ws.Range("D" & lngNewRow) = Range("D" & .Offset(1, 0).SpecialCells(xlCellTypeVisible)(1).Row).Value2 'PROCESSOR SERIAL NUMBER, processorSerialNumber
            End With
                
            Selection.AutoFilter
 
I did add the addin called PowerQuery which I don't know how to get rid of as I don't require it anymore.

I have also tried something like

Code:
.Range("A" & lngNewRow) = "123490EN400015"

Same problem.
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I have also tried something like

Code:
.Range("A" & lngNewRow) = "123490EN400015"

Same problem.
When I try add a second row of data in the Excel table, then it behaves in this way. If I run the code to enter data in the first row, then it works fine.
 
Upvote 0
I have also tried something like
Code:
.Range("A" & lngNewRow) = "123490EN400015"

Same problem.

Do you mean that you get, on that instruction, the error "2147417848: Automation error - The object invoked has disconnected from its clients" ?
 
Upvote 0
Do you mean that you get, on that instruction, the error "2147417848: Automation error - The object invoked has disconnected from its clients" ?
Yes
This is the first time I have dealt with Excel tables and I'm thinking it's that what's causing the problem but I don't know how.
 
Upvote 0
I ended up deleting the Excel table and just created a sheet and the code worked.
 
Upvote 0

Forum statistics

Threads
1,223,914
Messages
6,175,351
Members
452,638
Latest member
Oluwabukunmi

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