Method or data member not found (Error 461) RRS feed

  • Question

  • Have a tool developed for my business that is deployed on user computers.  Program works well on most computers.  Ran into a new issue today though, that has two sides.

    1) VBA won't compile saying there is a Method not found on TreeView.Node.  Code looks something like this:

    Dim nItem As Node

        For Each nItem In .Nodes 
            If nItem.Checked = True Then etc.....

    Compile fails on .Checked saying Method not found.  Library is properly referenced and there are no Missing References.  

    2) Incorrect type declaration for a variable. Again, this works properly on almost every computer.  Again this uses MSComctlLib library for Listview control this time.  The code looks like the following.

    Dim liTemp As MSComctlLib.ListItem

    For Each liTemp In lvTempData.ListItems

    On debug, lvTempData.Listitems is there and type set is proper, however liTemp is showing as columnheader type, not listitem.  Seems as if the call to the reference library is getting corrupted somehow.  Thinking about changing the type to variant instead to see if the system will overcome--even if it slows processing.

    Program is in Excel with VBA.  User emailed it back to me and I can replicate the problem on his file but it doesn't with the original file that was distributed.  Is this an issue of corruption and how do I avoid this when sharing the file?  Any help would be appreciated.  I am getting increasing disappointed with the issues in using MSComctlLib reference.  So much capability, but it seems unstable.  Note that in both cases I'm building the controls at runtime in the various forms.

    Monday, March 24, 2014 2:35 PM

All replies

  • Ok.  Interesting experience.  Ran the compiler and any place it broke on calling the Treeview control, I changed the variable to a Variant Type vs explicitly defining as node or some other such item. In doing so the other failure with the variable being improperly type set goes away.  So maybe the issues are related.  Still the question persists why variables defined expliciting calling MSComctLib fails this way.

    Monday, March 24, 2014 2:39 PM
  • One last point to make.  To get the compiler to work, I only set some of the explicit variables to Variant vs. Node, etc.  Others seem to work as expected.  It seems like the variables declared as MSComctLib.TreeView works properly, but declaring subordinate object like Node doesn't.  
    Monday, March 24, 2014 2:45 PM
  • After clearing all the compiler errors, I've gone back and redefined the variables as in the original version and everything works again.  Is this a compiler issue?  Am at a loss on how to manage the error when the tool gets distributed because it seems to persist once it's there.
    Monday, March 24, 2014 2:49 PM