resolve error of "unqualified method of an Office instance"

davidmyers

Board Regular
Joined
Jan 29, 2017
Messages
88
Office Version
  1. 2016
Platform
  1. Windows
on openning a userform with the following code:

Code:
Option Explicit


Private Sub CommandButton1_Click()
Unload Me
End Sub


Private Sub CommandButton2_Click()
Dim txt As String
Dim i As Integer
txt = ""
For i = 0 To Me.ListBox1.ListCount - 1
    If Me.ListBox1.Selected(i) Then
        If (txt > " ") Then
            txt = txt & ", " & Me.ListBox1.List(i, 0)
        Else
            txt = Me.ListBox1.List(i, 0)
        End If
   End If
Next i
ActiveCell.Value = txt
Unload Me
End Sub


Private Sub UserForm_Initialize()
ListBox1.ListIndex = -1
Me.StartUpPosition = 0
Me.Top = 40
Me.Left = 615
End Sub

I get
Automation error
The object invoked has disconnected from its clients


Googling this I found:
https://support.microsoft.com/en-us...-behavior-with-office-automation-when-you-use

Which says this is caused because: "[FONT=&quot]The code uses an unqualified method on an Office instance"

How do I qualify the method and resolve this issue?

Thanks for any help
David[/FONT]
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I've been googling the problems I'm having with this workbook and I discovered that I had a COM Add-in - Fuzzy Lookup Add-in For Excel - which I added ages ago, and no longer using so I deselected it - so I now have no COM Addins selected.
This change seems to have taken care of problems I was having, but I'm still checking / testing.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,021
Latest member
Justyna P

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