Consulting

Page 2 of 2 FirstFirst 1 2
Results 21 to 23 of 23

Thread: Solved: Bringing a list of available templates

  1. #21
    VBAX Regular Kelly's Avatar
    Joined
    Jun 2004
    Location
    Los Angeles, California
    Posts
    84
    Quote Originally Posted by TonyJollans
    Hi Kelly,

    Just starting to look at this and the routine looks like it needs a bit of tidying up to make sure the file names are properly attached to the buttons, etc., but the thing you say doesn't exist is actually CommandBars.ActionControl and is just what this process needs
    Tony!!!

    Thank you SOOOO much!!! I wanted this to exist so badly, and I am VERY relieved that it exists.

    I realize now why I couldn't find it. I was looking for the property to be part of each individual bar. You know, like each bar would keep track of the last button pressed. But since you can't simultaneously push two buttons on two bars at once, I guess it actually makes sense (sort of) for the whole CommandBars collection to keep track of the last button pressed.

    Thank you thank you thank you!!!

    so now we could change DeleteToolbar with something like:

    Sub DeleteToolbar()

    NameOfFile = CommandBars.ActionControl.Caption
    'open the file or whatever
    CommandBars("Template Toolbar").Delete

    End Sub

  2. #22
    VBAX Regular Kelly's Avatar
    Joined
    Jun 2004
    Location
    Los Angeles, California
    Posts
    84
    Quote Originally Posted by lynnnow
    Kelly, I actually need only one OnAction since it deletes the toolbar that is created and shows the userform. This will be for any file that I open, so it is not a problem. Writing several DeleteToolbar codes will increase the module size. But as you can try executing the above code, you will see that another userform is not needed.
    I'm so sorry you mistook my discussion of the multiple DeleteToolbar routines as a SERIOUS SUGGESTION. I was only trying to carry a flawed hypothetical idea to its logical conclusion to demonstrate how it was NOT a good idea.

    You are right about the UserForm. Now that Tony and the other coder have supplied the property I was looking for but could not find (I was looking for something like CommandBar(x).activebutton), then your original problem is solved and you would not be forced into creating a UserForm.

  3. #23
    VBAX Tutor lynnnow's Avatar
    Joined
    Jan 2005
    Location
    Mumbai, Maharashtra, India
    Posts
    299
    Location
    Hi Kelly,

    No harm done. The case seems closed as of now.

    Take care,

    Lynnnow

Posting Permissions

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