I have the following XML syntax i created using RibbonX
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<commands>
<command idMso="Bold" enabled="false" />
</commands>
<ribbon>
<tabs>
<tab idMso="TabHome" visible="false" />
<tab id="CustomTab" label="MyStock">
<group id="UserInterface" label="User Interface">
<button id="MyLogin" label="Login"
size="large" image="login" onAction="Login_User" />
<button id="NewUser" label="Add New User" getEnabled="getEnabled"
size="large" image="add_user" onAction="New_User" />
</group>
<!--adding product button-->
<group id="ProductInnterface" label="Product">
<button id="AddProduct" label="Add/Update Product"
size="large" image="product" onAction="Add_Product" />
<button id="ProductCat" label="Add Category"
size="large" image="product_cat" onAction="Add_Category" />
<button id="ProductUnit" label="Add Unit"
size="large" image="product_unit" onAction="Add_Unit" />
</group>
<!--adding sales buttons-->
<group id="ProductSales" label="Sales">
<button id="CashSales" label="Cash"
size="large" image="cash_sales_33" onAction="Cash_Sales" />
<button id="UpdateCashSales" label="Update"
size="normal" image="cash_sales_33" onAction="Update_Cash_Sales" />
<button id="CreditSales" label="Credit"
size="large" image="credit_sales_32" onAction="Credit_Sales" />
<button id="UpdateCreditSales" label="Update"
size="normal" image="credit_sales_32" onAction="Update_Credit_Sales" />
<button id="SalesDashboard" label="Sales Dashboard"
size="large" image="sales_dashboard" onAction="Sales_Dashboard" />
</group>
</tab>
</tabs >
</ribbon>
</customUI>
What i want to do is to add some VBA code that on WorkBook Open will disable all the ribbon buttons with the exception of the Login button.
A click on the Login Button should show Userform2 that has TextBox1 in which the user will enter his/her password. After entering the password, all the ribbon should be enabled.
Secondly on entering another password, only the sales buttons should be enabled.
Because i am new to this kind of xml syntax combined with vba, i have searched for so many solutions but could not get to find the correct on. I will be grateful if you guys can help me out. Please not: I am using excel vba. Thanks
1