How to make COM Add-in inactive? - vba

I have a COM Add-in, which I want to make inactive with VBA Code (or maybe with another Excel Add-in '.xla').
This is my company's internal COM Add-in.
Working of this COM Add-in: While closing a workbook, a form is generated. This form asks which type of workbook (like private, confidential).
This COM Add-in can be made inactive without VBA by the following method:
Excel>Options>Add-Ins
Click On 'Manage - COM Addins' and 'Go'.
Deselect that Add-IN from Add-in manager & Click 'Ok'.
However, after opening a new workbook the add-in starts working again.
The solution to this issue is to create VBA code (/Excel Add-in) with workbook_open event to disconnect the COM add-in:
Application.COMAddIns("AddinName").Connect = False
But getting below error:
This add-in is installed for all users on this computer and can only be connected or disconnected by an administrator.
If one can make this COM Add-in inactive manually then why is it not allowed with VBA code?

Related

How to interact with the 'Microsoft Dynamics Office Add-in' by VBA

In order to set up an automation of data refresh task, I would like to use VBA to ask the add-in "Microsoft Dynamics Office Add-in", to refresh and then refresh the power query connections to this file, and then move to the next one.\
I have tried to record a macro but VBA won't detect the button within the add-in pane that I clicked;I have also tried to reference to the add-in, however this add-in wasn't showing up, neither in the project explorer nor the references list.\
Is there a way to create VBA against this add-in? I have read the article at:
https://www.exceltip.com/custom-functions/how-to-use-your-excel-add-in-functions-in-vba.html
about how you set a reference but I could not even spot the add-in at the first step.
If it is not possible to get access to this add-in via VBA, is there any other methods to do for such automation task?\
Thanks!

VSTO Ribbon command restarts Office.js Add-In

I have a VSTO Ribbon for Excel and an Office.js add-in. I found that whenever any of the VSTO ribbon commands set app.SreenEnabling = false, or execute an app.run(), or execute TriggerEnabling(), the Office add-in restarts and loads all over again. At first I thought that it may be something in my add-in, but I even tested it with the default ExcelWebAddin.sln, and it restarts that also. Is there a way to keep the re-loading of the add-in to happen for those VSTO calls to Excel.

Excel custom Add-In not loading when instance of Excel is opened by another application

I have created a custom add-in for Excel and for the most this work fine without any issues.
However, we have a 3rd party application where we can select the option to "Open In Excel". This then loads a new instance of Microsoft Excel with a load of data populated from the application, but does not load the custom add-in.
If I go in to the add-ins option, I can see that Excel still seems to think that the add-in is enabled but I can see that it is not because the macros are not imported to workbook.
I can disable and then re-enable the add-in and it will work just fine. I can also open an Excel document or a new instance manually and it will work as expected. It only ever seems to be an issue when the instance of Excel is opened from this 3rd party application.
I assume that this is because the add-in is bound to my account and the process is being started by another account even though task manager sees it as being a process ran by myself.
If anyone has any ideas as to why this is happening or how to resolve it, I would be very grateful to hear.

Can't get the ribbon to appear in Outlook - addin from vb.net

I've created an Outlook 2010 Add-in (32 bit) using vb.net (2012). The add-in only has a ribbon tab and a small amount of code attached - just a msgbox for each button.
I've published and installed the addin, and installed the add-in in outlook. Restarted Outlook. The add-in appears to be active and this persists when outlook is restarted.
The ribbon doesn't appear.
As a test, I created another Outlook 2010 ribbon that adds text to newly created emails - that one works.
I'm new to vb.net.
What can I try next?
Fixed.
I hadn't set the RibbonType property of the ribbon to appear in the 'explorer' ribbon. The add-in was working, but I couldn't see that until I started to reply to an email.

VBA add-in: How to run code on "enabled"

I am writing an add-in for Excel 2003, using VBA.
I have an Auto_Open subroutine, which automatically runs some code (setting up menus, etc) whenever the add-in is Opened as a file.
What subroutine name (or other logic) do I need to use in order to have code that automatically runs when the add-in is "Enabled" through Excel's Add-in manager? (And, relatedly, when it is Disabled)
Auto_Open and Auto_Close will do what you want. Checking the addin in the Addins dialog opens it, and unchecking it closes it.
Check out the Workbook_AddinInstall Event.
From Excel's VB Help, this event:
Occurs when the workbook is installed as an add-in
Ex:
Private Sub Workbook_AddinInstall()
MsgBox "This workbook was installed as an addin."
End Sub
The Workbook_AddinUninstall Event fires when the workbook is uninstalled.