How to mimic tab onAction attribute?

爷,独闯天下 提交于 2019-12-12 02:36:07

问题


I need to activate a specific Sheet if corresponding tab is activated
XML

<tab id="books" label="books" onAction = "goTo1">

VBA

Sub goTo1()
Sheet1.Activate
End Sub

It seems onAction attribute for tab element doesn't exist (noComment)
Is there another way to do this?


回答1:


This would be using the Ribbon Interface "the other way round" - its not possible out of the box. The Idea of the ribbons is, that only actions and tabs are visible that make sense in the current sheet.

What you can do is have a timer on a hidden form that checks the active ribbon and activates the appropriate sheet. Getting the active tab is not trivial though - Look here for details.



来源:https://stackoverflow.com/questions/12685104/how-to-mimic-tab-onaction-attribute

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!