We help IT Professionals succeed at work.
Get Started

Object required  item.key

Jimmyx1000 asked
Last Modified: 2008-03-10
Hello I get an error of object not found

Why cant my program not find the object ,
im using this as a function in a bas module

Public t As Integer  

Public Sub HideDriveFunction()

Dim X

Item.Selected = True     ' i get error here  object not found - runtime error 424
X = Item.Key                ' i get error here  object not found - runtime error 424

    If X = "Optoin1" Then
    If ListView1.SelectedItem.Checked = True Then
    t = t + 1
    End If
    End If
    If X = "Option2" Then
    If ListView1.SelectedItem.Checked = False Then
    t = t - 1
    End If
    End If

For i = 1 To ListView1.ListItems.Count
    If ListView1.ListItems(i).Checked Then
        ListView1.ListItems(i).Selected = True
        ListView1.ListItems(i).Selected = False
    End If

Next i

MsgBox t

End Sub
Watch Question
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE