Programmatically launch VSTO Add-In with admin rights - vb.net

We have a VSTO add-in installed per machine. Our application, that runs with limited permission launches Excel and programatically enables the VSTO addin.
The problem here is if UAC is turned On we receive the below error:
"This addin is installed for all users on this computer and can only
be connected or disconnected by an administrator."
But i don't receive any error when UAC is turned off. So i understand that this is something to do with UAC and i cannot force the user to run my application as an administrator.
Is there anyway to launch Excel using InterOp with administrative rights?

Can you change the manifest of this addin ? In the manifest-file i usually set "admin required" when that is the case. Then the uac-prompt appears properly.

Related

Add-In not enabled after restart in Outlook 2010

I would appreciate any help as I have exhausted every solution I found at this point.
The Load Behavior of an Outlook Add-In is listed as "Unloaded" under File > Options > Add-Ins > COM Add-ins. It will load and work as expected if I manually check the add in. However it automatically disables when Outlook is restarted. I cannot find a way to make this stick. The following is what I have tried based on Google searches:
The registry shows that all available LoadBehavior options are set to 3, which indicates that it should load automatically. For good measure I searched for every occurrence of "LoadBehavior" to see if I was missing anything, but they are all set to 3.
The "Resiliency" options in the registry called "CrashingAddinList" and "DisabledItems" are empty, indicating that this add-in is not being forced to disable. Again I searched for every occurrence of this in the registry and they look good.
I added a "DoNotDisableAddinList" entry into the resiliency in the registry and gave it a value of 1. This is supposed to load the add-in no matter what.
I uninstalled the add-in, cleared out any reference to it in the registry, rebooted, and reinstalled. The same issue continues.
If I set the user as an administrator on their desktop, the add-in is loaded automatically in Outlook and works as expected. This is the only time it works, however nobody else has this issue and they are not set as administrators on the desktop.
Any ideas?
Thanks
Ian
Looks like your add-in fires an exception at startup...
Microsoft Office applications can disable VSTO Add-ins that behave unexpectedly. If an application does not load your VSTO Add-in, the application might have hard disabled or soft disabled your VSTO Add-in.
Hard disabling can occur when a VSTO Add-in causes the application to close unexpectedly. It might also occur on your development computer if you stop the debugger while the Startup event handler in your VSTO Add-in is executing.
Hard disabled add-ins are listed under the DisabledItems windows registry key.
Soft disabling can occur when a VSTO Add-in produces an error that does not cause the application to unexpectedly close. For example, an application might soft disable a VSTO Add-in if it throws an unhandled exception while the Startup event handler is executing.
When you re-enable a soft-disabled VSTO Add-in, the application immediately attempts to load the VSTO Add-in. If the problem that initially caused the application to soft disable the VSTO Add-in has not been fixed, the application will soft disable the VSTO Add-in again. See How to: Re-enable a VSTO Add-in that has been disabled for more information.

Message Compose Outlook add-in is not activated in Outlook 2016 desktop

I developed an add-in with a MessageComposeCommandSurface extension point.
It appears, is activated and works on outlook.office.com but with windows desktop client, Outlook 2016 (version 16.0.8625.2121), the button appears in compose mode but stays gray and it is not clickable.
I tested the command-demo-addin mentioned in Microsoft Docs and published on Github with the same result. Similarly, as shown on screenshot, it is impossible to click and launch the add-in which seems unactivated.
The COMPOSE buttons are disabled in the following instances:
1) The Item is in a public folder.
2) The Item is in Junk, Outbox (not drafts), or Sync Issues.
3) The item is "secure". DRM, or S-MIME encrypted. (older versions of Outlook also do not support S-MIME signed)
4) Outlook is offline.
In the situation where Read Mode add-ins are working, but Compose does NOT it is almost always #3. Usually the user will have on the option to always DRM / S-MIME their outgoing messages.
Update with image of security settings:
If Com Add-ins load a Custom Form this can also affect add-ins:
Checking Com Add-ins:
Note that outlook actually ships with some add-ins and a lot of com-addins work fine with Web Add-ins. It's only when Com Add-ins override the default new mail form (or other forms) that they can interfere with Web Add-ins.
Some COM add-ins will NOT use Custom Form, but will access the parent folder (item.Parent) and there is currently a bug that disable's Web Add-ins when a COM Add-in or VBA script does this.
File->Options->Add-Ins-> "Go" (next to manage add-ins)
If you have an antivirus instaled like avast, try to disable the addin of this and then try to open your compose mail window.

Add-in is not loading in office

I have a word com add-in that has been working fine previously but due to some reasons, I reinstalled my Windows-OS, MS-office and add-in software right after that It is showing in inactive add-in category. but the load behavior is "load at startup".
unable to find the exact reason. please help me and tell me how to debug this and know the root cause of this
There are multiple reasons why add-ins are disabled by host applications...
First of all, I'd recommend checking all the required prerequsites on the target machine. Make sure that al of them were installed correctly before running the host application with your add-in registered.
Microsoft Office applications can disable VSTO Add-ins that behave unexpectedly. If an application does not load your VSTO Add-in, the application might have hard disabled or soft disabled your VSTO Add-in.
Hard disabling can occur when an VSTO Add-in causes the application to close unexpectedly. It might also occur on your development computer if you stop the debugger while the Startup event handler in your VSTO Add-in is executing.
Soft disabling can occur when a VSTO Add-in produces an error that does not cause the application to unexpectedly close. For example, an application might soft disable a VSTO Add-in if it throws an unhandled exception while the Startup event handler is executing.
When you re-enable a soft-disabled VSTO Add-in, the application immediately attempts to load the VSTO Add-in. If the problem that initially caused the application to soft disable the VSTO Add-in has not been fixed, the application will soft disable the VSTO Add-in again. Read more about that in the How to: Re-enable a VSTO Add-in That Has Been Disabled article.
You may also find the following articles helpful:
Troubleshooting COM Add-In load failures
Troubleshooting Run Time Errors in Office Solutions

Unable to disable the Add-in in Outlook 2010

I am developing a vsto COM Add-in with form region for Outlook. It works fine. However, I am facing problems disabling the Add-in in Outlook 2010.
From the File Menu > Options > Add-ins > COM Addins (dropdown) , I am unchecking my Add-in. But when I restart Outlook, the add-in is enabled again. If I check in the COM Addins list, its again enabled. Even the registry entries indicate that the Add-in is enabled again. Does anyone know what might have caused this? Can enabling and disabling be handled in my code, or will it be taken care by Outlook itself.?
If the addin is installed in both HKCU and HKLM, make sure you disable it in the HKLM registry hive.
Typically when any changes made in the host application run under regular user privileges are written to the HKCU hive. For example, if the add-in is registed in the HKLM hive any changes in the UI are written to the HKCU hive due to the fact that the host application was not launched with admin privileges (which is required for writing to the HKLM hive). See Registry Entries for Application-Level Add-Ins for more information.
P.S. Try to run Outlook with admin privileges and see the difference.
As it turns out, its is a bug in Office 2010 Professional. To disable the add-in, you need to run Outlook as an admin, and then disable the add-in.

How to display Custom Taskpane in Office 2013?

I have developed an Excel Addin using VSTO 4.0.
There is a Custom taskpane that contains various controls to perform functions.
the Custom Taskpane works fine with office 2010 and is displayed on left.
but When i install the addin for office 2013 on Windows 8.1 it does not apear at all?
Below is the code snippet im using to display the taskpane;
var taskPaneProcessMapView = new TaskPanes.taskpaneProcessMap().GetInstance();
this.TaskPaneProcessMap = Globals.ThinkReliabilityAddIn.CustomTaskPanes.Add(taskPaneProcessMapView, "Process Map");
this.TaskPaneProcessMap.Visible = false;
this.TaskPaneProcessMap.Visible = false;
May be you need to set the Visible property to true?
Anyway, is your add-in enabled? Did you have a chance to check out the COM add-ins list in Excel? Is it listed in the Inactive add-ins list?
Microsoft Office applications can disable add-ins that behave unexpectedly. If an application does not load your add-in, the application might have hard disabled or soft disabled your add-in.
Hard disabling can occur when an add-in causes the application to close unexpectedly. It might also occur on your development computer if you stop the debugger while the Startup event handler in your add-in is executing.
Soft disabling can occur when an add-in produces an error that does not cause the application to unexpectedly close. For example, an application might soft disable an add-in if it throws an unhandled exception while the Startup event handler is executing.
When you re-enable a soft-disabled add-in, the application immediately attempts to load the add-in. If the problem that initially caused the application to soft disable the add-in has not been fixed, the application will soft disable the add-in again. See How to: Re-enable an Add-in That Has Been Disabled for more information.