如何dynamic填充自定义function区上的菜单控件?

For Each ws In Worksheets ListBox1.AddItem ws.Name Next ws ListBox1_Click() Worksheets(ListBox1.Value).Activate 

我可以用自定义function区上的菜单控件来做同样的事情吗?
XML:

 <menu id="mnuCats" label="abc" size="large" imageMso="PropertySheet" > <button id="go01" label="sky" onAction="go01" imageMso="TextAlignGallery" /> <button id="go02" label="sea" onAction="go02" imageMso="TextAlignGallery" /> </menu> 

那么,如何用表格名称填充菜单以及如何将button的标签属性作为string来激活相应的表单。

您需要一个下拉式色带控制。 如果在Excel文件中input以下customUI XML(可能使用自定义用户界面编辑器http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2006/05/25/customuieditor.aspx ),则可以获取列表正确的VBAcallback签名您需要执行以填充值和响应操作:

 <dropDown id="drpTest" label="Test" showImage="false" getSelectedItemIndex="TestGetSelItem" onAction="TestOnAction" getItemCount="TestGetItemCount" getItemID="TestGetItemID" getItemLabel="TestGetItemLabel" sizeString="HowBigDropdownDoYouWant" supertip="Select Test."> </dropDown>