+ Reply to Thread
Results 1 to 3 of 3

How to run a commandbar controled module inside a Macro

  1. #1
    Registered User
    Join Date
    08-03-2006
    Posts
    7

    How to run a commandbar controled module inside a Macro

    I have installed an Excel module to translate selected cells into another language. The module is controled by a set of command bars. I want to run the translation module from inside a Macro, but I don't know how. I tried the macro recording, but it did not record any code. Below is part of the translation commandbar module. Can anyone tell me how to run the module from a Macro? Thanks.




    Sub LocalizeButtons()

    Dim CommandBar As CommandBar
    Dim ComboBox As CommandBarComboBox

    Set CommandBar = CommandBars("PROMT6 SmarTool")

    Set CommandBarControl = CommandBar.FindControl(Tag:="PROMT_ST_DIRECTION")
    Set ComboBox = CommandBarControl
    ComboBox.Clear
    CommandBarControl.Caption = "Direction of Translation"
    CommandBarControl.TooltipText = "Direction of Translation"
    CommandBarControl.Enabled = True
    Set CommandBarControl = Nothing
    ...

    End Sub

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Perhaps the attached will help, it has menu & sub menu setup items with easy understanding.

    ---

    Quote Originally Posted by betty77
    I have installed an Excel module to translate selected cells into another language. The module is controled by a set of command bars. I want to run the translation module from inside a Macro, but I don't know how. I tried the macro recording, but it did not record any code. Below is part of the translation commandbar module. Can anyone tell me how to run the module from a Macro? Thanks.




    Sub LocalizeButtons()

    Dim CommandBar As CommandBar
    Dim ComboBox As CommandBarComboBox

    Set CommandBar = CommandBars("PROMT6 SmarTool")

    Set CommandBarControl = CommandBar.FindControl(Tag:="PROMT_ST_DIRECTION")
    Set ComboBox = CommandBarControl
    ComboBox.Clear
    CommandBarControl.Caption = "Direction of Translation"
    CommandBarControl.TooltipText = "Direction of Translation"
    CommandBarControl.Enabled = True
    Set CommandBarControl = Nothing
    ...

    End Sub
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    08-03-2006
    Posts
    7
    Thanks for your reply. I installed your sample file in excel, but I got an error when opening it. After going through the vba code in your file, I still can not figure things out. Would you please explain further how exactly I should do to call the commandbar controlled module using vba code? Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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