Get COM enabled VBA compatible VSTO project to work using an installer

First, here is what we are looking for our of our VSTO

  • VSTO just works
  • VBA code can use the new libraries AND have intellisense (eg pre-binding)
  • to be used by all users of the computer (click once installer is thus ‘out’ thus – custom installer)

UPDATE: This article has the answer: The stuff below is also good information to use and do.

All went well until the other developer started “handing over” code to me after he renamed the modules so they would group together (prefixed w. the same 3 letters). Sometimes things would just work and the VSTO stuff written in c# would just work from VBA and then for days on end – nothing. What was going on is that a build from Visual Studio as a designer did all the proper registry additions and the installers missed a few.

Using RegShot – we narrowed it down to a few items that were missing. The project had some deficiencies though.

  1. paths on my new VM which we used to back track things were not relative. Use this article to replace the solution directory with a variable <VSSolutionFoler> or since it is in an xml file – &lt;VSSolutionFoler&gt; (which is what you would copy in to your .isl file. So if your project is c:\users\bob\Desktop\mysoldir\myproj\myproj.sln then replace the parent directory with &lt;VSSolutionFoler&gt; for files you want copied. THEN open your project and check the Files section of your InstallShield wizard setup to ensure it worked. Rebuilld and you should have no errors in your output log.
  2. Certain items in order to build the custom InstallShield installer needed to be downloaded  – solution here
  3. GUID’s for registry items kept changing – how to calm that down to be constant guids

Other Links:

  • http://stackoverflow.com/questions/148879/why-does-my-net-application-crash-when-run-from-a-network-drive (link)
  • https://msdn.microsoft.com/en-us/library/t71a733d(v=vs.140).aspx (link)
  • http://stackoverflow.com/questions/33230794/deploying-vsto-add-in-to-all-users (link)
  • http://sharepoint.stackexchange.com/questions/105992/which-special-characters-are-not-allowed-in-sharepoint-2013-files-folders (link)
  • https://msdn.microsoft.com/en-us/library/cc442767.aspx#Obtain (link)
  • https://msdn.microsoft.com/en-us/library/bb608621.aspx (link)
  • https://msdn.microsoft.com/en-us/library/microsoft.office.tools.addinbase.requestcomaddinautomationservice.aspx (link)
Share Button

Leave a Reply

Your email address will not be published. Required fields are marked *

Please answer the question so the system knows your a human and not a web-bot * Time limit is exhausted. Please reload CAPTCHA.