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


Set Focus

Posted on 2002-06-16
Medium Priority
Last Modified: 2010-05-02
Why ,when I use ListView Object and I write :
I receive an error:"Invalid procedure call or argument"
Object is enable ,I cant't understand where is the problem
Please ,help me .
Question by:Vlad77
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

Expert Comment

ID: 7081522
Do you have any code in the Listview's events that may be raising this error?  Check your events for the Listview and step through them in debug.

Expert Comment

ID: 7081584
Is the form which it resides on visible at the moment of setting focus ? It must be, or "Invalid procedure call or argument" will occur.
LVL 70

Expert Comment

by:Éric Moreau
ID: 7081625
the listview and the form must be visible and enabled before setting focus to it.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Expert Comment

ID: 7082865
I think that definately ur enabled property of the list view is False.  Make it true and try again.

Expert Comment

ID: 7083741
it can be if your form where the listview resides isnt actice

Accepted Solution

marconovaro earned 150 total points
ID: 7091868
This usually happens when you call SetFocus() on the Form_Load, where the destination object (i.e. the one you are trying to setfocus) is not yet visible.
If this is the case, you can use the Form_Activate event, or you can use On Error Resume Next.
Hope this helps you.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
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