Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Dallas plus 20 miles or so, Texas, USA
    Posts
    876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Referring to toolbar controls (2000)

    Is there any way to refer to a toolbar control using something other than .item(number)?

    I am trying to make a toolbar controlbutton invisible upon a sheet deactivate event, then make it visible again on the activate event. This is in the sheet activate event. Abar7 is the commandbutton object (I think). I have dimmed and created it when the toolbar was created at workbook open. In any event, the method I seem to be trying to use to refer to the control does not seem to be a valid method.
    <pre>With CommandBars("Acc401Bar").Controls
    Abar7.Visible = True
    End With
    </pre>


    Thanks

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Referring to toolbar controls (2000)

    Without seeing the rest of your code, it is a little difficult to know exactly what you are doing. From the code you posted, the following might work for you:

    <pre>With CommandBars("Acc401Bar").Controls("Abar7")
    .Visible = True
    End With
    </pre>

    Legare Coleman

  3. #3
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Dallas plus 20 miles or so, Texas, USA
    Posts
    876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Referring to toolbar controls (2000)

    Thanks Legare,

    What I finally used was

    <pre>With CommandBars("Acc401Bar").Controls(5)
    .Visible = True
    End With
    </pre>


    I couldn't figure any other way to access it without using the number.

    Thanks,

Posting Permissions

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