vibhor Gupta
vibhor Gupta

Reputation: 123

how to hide and show button on excel ribbon using VBA

Hii guys I am working a excel addin project which add custom ribbon using the ribbon xml structure defined by microsoft. I have 2 button on this ribbon login and logout .Now when the excel load I want to show login button only and when user login hide login button and show logout button . Now the challange is I need this changes to take place at runtime when excel is running . and I unable to get any reference for this hide and show functionality

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
    <tabs>
        <tab id="Tab1" label="Add-in">
            <group id="Tools" label="Tools">
                <button id="Login" label="Login"/>
                <button id="Logout" label="Logout"/>
            </group>
        </tab>
    </tabs>
</ribbon>

Although the project is in python using pyxll addin but any VBA solution can also be incorporated. I am unable to find any article or reference for my problem so any help will be appreciated.

Upvotes: 0

Views: 298

Answers (0)

Related Questions