Assigning ICON to ADD-INS and adding to ribbon

newexcler

New Member
Joined
Nov 15, 2015
Messages
39
Hi Experts.
Note: I tried below in reddit, I recently joined but it's been 12 hours, my question does not even show up. So come back here in trust.

Problem statement: Sharepoint Excel which is password protected has a bug, users can clear off the filters, but they cannot set it back as it requires password.
What I have done till now:
What I did was to create a simple macro, but to deploy in Sharepoint, saved as add-ins (.xlam) but, I want users to easily click with hidden code, as it is password protected.
I could only see macros can be associated with icon and can be added in Ribbon but add-ins, I googled but I am bit confused, as most of the material is to create a new ribbon with XML.
Please can you help me.
Here is the basic code, I have written

VBA Code:
Option Explicit

Sub SecurefileFilteron()

Call UnProtectPassword
Call RPFilterONOFF
Call ProtectPassword
End Sub

Public Sub ProtectPassword()
ActiveSheet.Protect Password:="test123", AllowFiltering:=True
End Sub

Public Sub UnProtectPassword()
ActiveSheet.Unprotect Password:="test123"
End Sub

Public Sub RPFilterONOFF()
    Rows("4:4").AutoFilter
'    Rows("4:4").Select.AutoFilter
''    Selection.AutoFilter

End Sub

2021-01-12_23h47_34.png


Please can you help me how to create one click solution to make it easy for end users, while protecting the password of the spread sheet.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,215,029
Messages
6,122,760
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top