Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jul 2008
    Location
    Suffolk, United Kingdom
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Validate if a command bar exsists (2000 / 2003)

    Hi,

    I am using CommandBars("SLS").Delete to remove a command bar, I distribute this within a word document so the user can automatically install the commandbar to there PC.

    I am getting an error if the commandbar does not exsist.

    Is there a way to check if it is there before executing the delete command?
    Regards
    Gerbil (AKA Kevin)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Validate if a command bar exsists (2000 / 2003)

    The easiest workaround is to turn off error handling temporarily:

    On Error Resume Next
    CommandBars("SLS").Delete
    On Error GoTo ...

    where ... can be 0 to turn on VBA's built-in error handling, or the name of a label.

Posting Permissions

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