Consulting

Results 1 to 2 of 2

Thread: Strange Error When passing Treeview to sub

  1. #1

    Strange Error When passing Treeview to sub

    I'm having an issue that I don't understand (obviously). I am passing a Microsoft Common Controls library object to a subroutine. I have done this before without issue. However, I am now getting an error that "Object does not support this property or method." I'm not trying to access any properties or methods. I'm passing the entire object as I always have.

    Here are the details:

    Declaration:

    Dim tv As MSComctlLib.treeView
    Set tv = Me.tvObjectProperties.Object

    The offending line:

    RightClickNode(tv)

    And the declaration for the sub:

    RightClickNode(tv as MSComctlLib.treeView)

    What am I missing here?

    --------------------------------------------------------------

    Never mind. I found it. Someone had copy the code from another module and placed it in the form module. You can't pass form objects as arguments with the same form.
    Last edited by slowchaos; 02-16-2021 at 03:57 PM.

  2. #2
    VBAX Regular
    Joined
    Nov 2020
    Location
    Swansea,South Wales,UK
    Posts
    86
    Location
    Perhaps mark it as Solved then?

Posting Permissions

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