End

If you refer to a control by using its caption, the caption must exactly match the text displayed in the menu. In the preceding procedure, I had to use ellipses (three dots) after the word New because that's how it appears in the menu. You can mix and match index numbers with captions, if you like.

You might find the next procedure instructive. It loops through all the Controls (menus) in the Worksheet menu bar. For each of these menus, it loops through the Controls (menu items) within the menu. For each of these menu items, it loops through the Controls (submenu items). The result is a listing of all menus, menu items, and submenu items in the Worksheet menu bar.

0 0

Post a comment