Using Registry to install Excel AddIn - excel

I created an excel Add-In called
Project Count_Per Person.xlam
When I open up excel and go to Development>AddIns and select my AddIn to install, it does not stay installed if I close out of excel even after saving. The AddIn I made, creates a new MenuBarButton under the tab 'AddIns'
So I created a new registry Key to install the addin at startup under
HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins\ProjectCount_PerPerson
The Key looks like this
(Default) REG_SZ (value not set)
Description REG_SZ Project Count_Per Person
FriendlyName REG_SZ Project Count_Per Person
LoadBehavior DWORD 0x00000003 (3)
Manifest REG_SZ C:\Users\b012918\AppData\Roaming\Microsoft\AddIns\Project Count_Per Person.xlam
When I start Excel, it displays that it is installing the AddIn, but then I get an
Exception reading manifest from
file:///C:/Users/b012918/AppData/Roaming/Microsoft/AddIns/Project%Count_Per%Person.xlam:
the manifest may not be valid or file could not be opened.
http://pastebin.com/bN1datV5
Any insight into what I'm messing up would be beneficial.
Additional Information:
If the addin is uninstalled when I start excel, it gives the manifest error. If the addin is 'checked' when I start excel, it gives the download error in the comment below. Even if the addin is previously installed, the CommandBarButton does not stay in place. Also, under options--> addins the addin is stated to be "Active".

Just to clarify, there are two types of addins for Excel (and the other Office apps), VBA addins and COM addins. A COM addin is developed via Visual Studio and the Visual Studio Tools for Office. That is what brett s is referencing to.
But the more likely type are normal VBA Excel Addins, typically distributed via a .xlam file.
In order to load such an addin automatically for a user, you need the addin file on some local directory on the machine and reference it via the Registry.
For Excel 2010, a REG file to load the corresponding registry key is:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\Options]
"OPEN"="C:\\Path\\To\Addin\\Addin.xlam"
This way the addin is loaded everytime you start Excel.

I Built an Add-In called 'FirstExcelAddIn' with Visual Studio, and checked to see what it did when It built the Registry Keys. I had my registry correct from the keys shown in the question, I just did not have all the files it was looking for in a COM addin.
Here is what my functioning addin looks like in the registry
(Default) REG_SZ (value not set)
Description REG_SZ FirstExcelAddIn
FriendlyName REG_SZ FirstExcelAddIn
LoadBehavior DWORD 0x00000003 (3)
Manifest REG_SZ C:\Users\b012918\AppData\Roaming\Microsoft\AddIns\FirstExcelAddIn.vsto|vstolocal
Here are the files that need to be present in the folder for the addin to work properly
FirstExcelAddIn.dll
FirstExcelAddIn.dll.manifest
FirstExcelAddIn.vsto
Microsoft.Office.Tools.Common.v4.0.Utilities.dll
I suspect that if you went through the effort to write your Add-In from scratch without tools, you would only need the '.dll' and '.dll.manifest' for your addin to work.

Related

Installation of VSTO by adding registry in end user computers

I've developed a VSTO addin for excel with VS2019. In my company execution of exe files are controlled by privilege management software (https://www.beyondtrust.com). For this reason, I don’t want to crate window installation file or setup.exe file. For this reason, I am traying to install VSTO by adding registry. My steps are as follow,
I have run VSTO addin from VS2019.
I have copy all registry from
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Excel\Addins
HKEY_CURRENT_USER\SOFTWARE\Microsoft\VSTO\Security\Inclusion
HKEY_CURRENT_USER\SOFTWARE\Microsoft\VSTO\SolutionMetadata
Deleted all above-mentioned registry.
Moved all files (dll, manifest, VSTO etc) generated by VS2019 in new folder.
Re added all registry with old GUID and RSA key but only modification of path for new path of VSTO files.
After that whenever I launch excel, my addin do not load and load behaver changed from 3 to 2. No matter even I change to 3, it got changed as 2. It always shown me my addin in inactive addin my option of excel.
Can anyone guide me?
Thanks
Best way is to create COM-AddIn using IExtensibility instead of VSTO addin.
It is similar to VSTO. Only change is u need to do everything by yourself including
user/machine registry

clickonce auto update issue

I have an excel vsto add-in. I am distributing this add-in by sharing the clickonce installer file. Later, I tried to make this application auto update. for auto updating my application, I created a c# console application, which
downloads the latest clickonce installer
closes the excel
uninstalls previous version of addin
opens the clickonce installer
the first 3 steps are working fine.
for the fourth step I used Porcess.start('file_location to clickonce setup.exe)
if the user account is admin, there would be no problem, otherwise it would ask for admin password, if the admin password is given, the addin gets installed in the admin account and not in the user account.
I am struggling to actually understand how to auto update vsto addins if clickonce is used and distributed manually.
I think you may have misunderstood how ClickOnce is intended to be used with VSTO.
Basically all you have to do is deploy your addin using ClickOnce see
here which it sounds like you're already doing and then under Project Properties - Publish look for:
Install Settings - Updates - Set to your update interval (e.g. every time the customization runs)
This will then cause your VSTO addin to update automatically every time Excel starts (or based on your interval). There's no need to manually fire off the installer, close Excel, etc. it's all handled by ClickOnce.
That being said, according to this and that MSDN link, ClickOnce is not suitable for multiple users, but I assume that your use case is to have the same user both install and use the Addin.

Does Excel Add-In VSTO 2005SE Need Manifest Files?

We developed application level Excel Add-In in Visual Studio 2005 using VSTO 2005SE. The add-in installs and works fine on Excel 2003, 2007 and 2010 (32-bit) on the most of computers. However, in some cases Excel does not load it, despite the fact the registry LoadBehaviour (LB) value is set to 3 during the installation. When the user un-installs the add-in the LB is still set to 3, so I assume there is no error happens during initialization and loading, otherwise LB will be 2 or even 1.
We use MSI installation and deploy the add-in on application level with Local Machine registry keys.
When we build the add-in in Visual Studio 2005 there is no manifest files generated, so we don’t include these files in our MSI installation and there is no registry key entry for the manifest. So, we assumed the manifest is not essential part.
Even more, according to http://msdn.microsoft.com/en-us/a3swb498(v=vs.80) the application manifest provides information that is used by an Office solution to locate and update its assemblies. Since we have only one assembly that is a solution, we don’t need any manifest.
Our MSI file, add-in assembly and setup.exe files are signed with the COMODO certificate.
Does anyone know if we need an application and deployment manifests and if so how can we generate ones?

64- bit Microsoft Excel 2010 Addin loading error

I developed a 64-bit Addin.
For testing I added it on a laptop (64-bit machine with 64-Windows7 Enterprise and 64-bit Office 2010) [other than the one i developed the Addin on], its works fines i can call n use its functions. but when i add the same addin on a desktop machine (64-bit machine with 64-Windows7 Enterprise and 64-bit Office 2010), its functions are not available and no error message displayed as well. But when i re-launch Microsoft Excel 2010 a message appears.
Message text : "The file you are trying to open, 'MyAddin.xll', is in a different format than specified by the file extension. Verify that the file is not corrupted and is in from a trusted source before opening the file. Do you want to open the file now?"
As per the message text i verified that the location for xll is included in "trusted location". Yet the issue not resolved.
Whats your opnion in this regard,
Thanks & Regards,
Maverick.
Check that you have compiled it Release and not Debug (if you've done the latter it will only work on machines with the debug versions of included DLLs, which usually means machines with Visual Studio installed).

Where are all the places that VBA macros for Excel 2007 can be turned off?

Macros refuse to run for me in Excel 2007 on Windows Server 2003.
The macro and visual basic icons on the ribbon are grayed out.
If I open a workbook with a macro, I get the warning: " This workbook has lost its VBA project, ActiveX controls and any other programmability-related features."
If I try to make a new excel template in VSTO (Excel is closed at the time), I get the error: "Programmatic access to the Microsoft Office Visual Basic for Applications project system could not be enabled. . ."
I checked that VBA was installed (originally it wasn't, I added it via office setup). I also tried uninstalling and reinstalling office and VBA, no dice.
I made a macro-enabled workbook.
I set the workbook's location to trusted.
I configured all of the security settings available under Excel Options/Trust Center to allow-everything-no-prompts.
I set "Enable all macros" and "Trust access to the VBA object model".
I downloaded the group policy admin templates and verified none of this is being set via group policy.
That's everything I can find in Google to try, but clearly there is another place that VBA can be turned off. Where else can I look?
Are you sure there isn't a system policy in place that inhibits VBA?
Edit: Some reading, if you've not already seen these:
http://support.microsoft.com/kb/282847/en-us
http://support.microsoft.com/kb/287567
http://support.microsoft.com/kb/281954/en-us - Applies to earlier versions, but some/all may still be relevant to 2k7
Alt+F11 in excel and see if there is an option in there that you can change....

Resources