+ Reply to Thread
Results 1 to 5 of 5

Listview runtime.. not working

  1. #1
    Registered User
    Join Date
    09-21-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    61

    Listview runtime.. not working

    Hi,

    I created a form (VBA + Access) which have 2-3 Listview controls. This tool will be shared to my whole team. Listview ref is missing in many of the user's systems. I got a couple of codes to add listview ctrl on runtime. But this is not working. Kindly review the below code and help me to sort this out. Thanks in advance.
    Please Login or Register  to view this content.
    Also:-

    Please Login or Register  to view this content.

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Listview runtime.. not working

    Kiran,

    you may want to elaborate a bit on "But this is not working". Error message or problem?
    If you like my contribution click the star icon!

  3. #3
    Registered User
    Join Date
    09-21-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Listview runtime.. not working

    Hi,

    The first set of code (AddListViewControl) doesn't throw any errors. Second set of code results in a 'Type mismatch' error on line 'Set ctl = .Controls.Add("MSComctlLib.ListViewCtrl.2", "ListView1")'
    Is there any non ocx listview cntrl that i can use?

  4. #4
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Listview runtime.. not working

    Hi Kiran,

    Please declare ctl as a ListView type of object, or use the generic "object" type if you want to use late binding

  5. #5
    Registered User
    Join Date
    09-21-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    61

    Smile Re: Listview runtime.. not working

    Hi,

    Thanks you!! Its working...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1