+ Reply to Thread
Results 1 to 9 of 9

UserForm Treeview

  1. #1
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    UserForm Treeview

    How can I make a userform treeview open to the first node everytime its open.Now it open
    to last selected node.
    Last edited by zplugger; 01-09-2015 at 08:46 AM.

  2. #2
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: UserForm Treeview

    Would it help to post example workbook?

  3. #3
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: UserForm Treeview

    Here is the workbook I trying to make the treeview default to first item on open, maybe someone can see whats wrong.

    Thanks Z
    Attached Files Attached Files

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: UserForm Treeview

    the nodes Selected property set to True will select it.

    You have interactions going on in your user form that appear to be obsucring the fact the selected node has changed. Not easy or quick to route out the cause though.
    Cheers
    Andy
    www.andypope.info

  5. #5
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: UserForm Treeview

    Thanks for looking Andy, I will keep trying to find whats going on.

    Z

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: UserForm Treeview

    add this to end of userform initialize event

    Please Login or Register  to view this content.
    and use this modified event routine
    Please Login or Register  to view this content.
    SelectNode is only called if userform is visible. This appears to allow the selection to work.

  7. #7
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: UserForm Treeview

    Thanks Andy
    Working the way I want it too now,just need to work on some other bugs.I'm using this as a add-in but every time I open it I get a blank space on my right click menu?

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: UserForm Treeview

    I don't get the blank spaces using the example file you posted.

  9. #9
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: UserForm Treeview

    I only got the blank spaces when I used the file as a add-in, got that problem fix with some code change in the workbook close event.I'm
    able to delete nodes without a problem,but I need to find a way to delete different Library's. The Combo box shows different library's that you
    can create,when I delete one I get a out of bounds error and the file doesn't work any more.Maybe a command button to delete a library.

    Z

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. TreeView Help
    By texanjohn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2009, 03:05 PM
  2. How to use a Treeview control in a UserForm
    By rich534714 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-19-2007, 10:46 AM
  3. [SOLVED] Embed Folder Treeview Or Windows Explorer On UserForm
    By MDW in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-27-2006, 11:55 AM
  4. TreeView
    By Stephen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2005, 02:05 PM
  5. TreeView Help
    By Tony in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-21-2005, 01:05 PM

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