azizrasul
Well-known Member
- Joined
- Jul 7, 2003
- Messages
- 1,304
- Office Version
- 365
- 2019
- 2016
- Platform
- 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?
-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