Possible?

Oorang

Well-known Member
Joined
Mar 4, 2005
Messages
2,071
I am very comfortable with VBA and am willing to branch out to other languages if needed to accomplish this. Is it possible to have excel run an add-in but not have it show up in the add-in dialog box in the tools menu?
(If have users who will turn then off because they don't know what it is.)
Alternatly does anyone have any ideas about just preventing people from disabling my add in?
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
How about disabling the Add-In menu or password-protecting it so noone can uninstall your custom AddIn unless of course you want your users to acccess the AddIn Dialogue Box with no restrictions?

Regards.
 
Upvote 0
Password-Protecting the Add-In dialogue box will still prevent users from accessing the all the Add-Ins which is not what you want.

The only solution I can think of is probably rebuilding the whole Add-Ins Dialogue Box using a custom UserForm which will mimic the built-in Add-Ins dialogue Box but will omit your particular Add-in.

Of course this involves some more coding so I am not sure it would be worth it.

Regards.
 
Upvote 0
I can do that... ROFL... hmmm that could actually work. It sounds like the Sony-Way but it would work.

An alternate idea... anyone know of how to just prevent it from appearing in the list?
 
Upvote 0
anyone know of how to just prevent it from appearing in the list?
Oorang,

I don't think that is possible unless you rebuild a similar Add-ins list via a UserForm as I mentioned earlier...



Here is another approach ( or rather a trick) , not very elegant, But it does prevent users from disabling your AddIn.This approach makes use of the handy AddinUninstall event of the Addin.

However, for this approach to work, you will have to create a Personal.xls workbook ( Unless you have one already) and add a small routine to one of its Standard Modules as follows :

Code:
Public Sub ReinstallAddin()

    Dim strAddInName2 As String
    strAddInName2 = Evaluate(Application.Names("AddinName").RefersTo)
    Names("AddinName").Delete
    AddIns(strAddInName2).Installed = True

End Sub

Note that to create a Personal.xls , you need to save a Workbook in the XLSTART folder under the name of Personal.xls.
In my machine, this folder is located in : C:\Program Files\Microsoft Office\Office10\xlstart ( WXP XL 2002 )


Now, you need to add the following code to your AddIn in the ThisWorkBook Module:

Code:
Private Sub Workbook_AddinUninstall()

    Dim strAddInName1, strPass As String
    strAddInName1 = Left(Me.Name, Len(Me.Name) - 4)
    Application.Names.Add "AddinName", strAddInName1
    strPass = InputBox("Enter password to Un-Install the AddIn :", strAddInName1)
    If StrPtr(strPass) = 0 Then 'if Cancelled reinstall
       GoTo ReInstall
    ElseIf UCase(strPass) <> UCase("YourPassWord") Then 'else msgbx + ReInstall
       MsgBox "Wrong Password !" & vbCr & vbCr & _
        "Un-installation unsuccessful !", vbCritical, "Un-Installing " & strAddInName1
    Else
       Exit Sub ' else do nothing
    End If
ReInstall:
    Application.OnTime Now + TimeSerial(0, 0, 1), "Personal.xls!ReinstallAddin"

End Sub

Notice the password I have used in the code is "YourPassWord". Change this as required.

Finally, you need to save the changes you made to the two files ( Addin and Personal.xls) .


Now, if the user tries un-installing your AddIn, they will be prompted for a password.If the password is not valid, the AddIn will re-install itself immediatly.

Regards.
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,383
Members
448,956
Latest member
JPav

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