Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Same Error Everytime! List1.RemoveItem (0)

Posted on 2004-08-10
6
Medium Priority
?
196 Views
Last Modified: 2012-05-05
I think its trying to delete what's not there anymore.  After I press the stop button, i make it clear the lists, and disable timer. but this error always pops up afterwards.  is there a way to fix this?

In A Timer:

If List1.ListCount > 0 Then
 List1.Selected(0) = True
    Parsemeth1 (List1.List(0))
    List1.RemoveItem (0) <----------------------invalid procedure call or argument.
    If List1.ListCount = 0 Then
        Timer4.Enabled = False
        End If
        If Text44 = "0" Then
        Timer4.Enabled = False
        End If


 thank you.
0
Comment
Question by:andyakira
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 11769623
Try:

List1.RemoveItem 0

or

Call List1.RemoveItem (0)

cheers
0
 
LVL 14

Expert Comment

by:aelatik
ID: 11769974
>>>>> List1.RemoveItem (0) <----------------------invalid procedure call or argument.

Change it to :

If List1.ListCount > 0 then List1.RemoveItem (0)
0
 
LVL 7

Expert Comment

by:_agj_
ID: 11770004
if u clear the list when u press ur stop button, can see how it enters the loop:

If List1.ListCount > 0 Then   <---this should be 0

also  why do u do this: List1.Selected(0) = True
                                  Parsemeth1 (List1.List(0))

when u do a:
        Timer4.Enabled = False

also set: Timer4.interval = 0.

i have a feeling this is because of multiple timers...are u disablign the correct timer?

also...set a breakpoint in this function and check the value of listcount etc..

i am also wondering if it shud be .Remove(1).....forget whats the base of a list...
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:Mahdi Mansour
ID: 11770779
if what u r trying is only to clear the list and stop the timer use :

Private Sub Timer1_Timer()
If List1.ListCount > 0 Then
 List1.Selected(0) = True
   
    List1.RemoveItem (0)
  End If
   If List1.ListCount = 0 Then
      Timer1.Enabled = False
      End If
   

End Sub
0
 
LVL 23

Expert Comment

by:Ioannis Paraskevopoulos
ID: 11771368
private sub Button_click()
   list1.clear
end sub
0
 
LVL 26

Accepted Solution

by:
EDDYKT earned 240 total points
ID: 11771776
just put

on error resume next


at the beginning

8->
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question