Install Powerpoint addin via script - vba

I'm trying to install an addin to Powerpoint via any script. I found this code but can anyone guide me how to run this script or create a bat file out of this. we have an installer, but that requires ppt to be closed and do not update to new version (uninstall existing addin and add new version of same addin) so everytime we have a new version of the addin, planning to trigger this script in user's machines during startup before ppt is opened.
Any other ideas welcome too.

As long as PPT is not running, all you need to do to update an add-in is to copy the new version in, letting it replace the existing one.
You could, for example, use a startup BAT file that invokes XCOPY or ROBOCOPY to copy the PPA/PPAM file only if it's newer than the one already in place.
Note: this assumes that you're talking about a VBA add-in (PPA/PPAM). If it's a .NET add-in or some other type of COM add-in, this probably won't work

Related

Is there any way to embed a VSTO add-in into a document?

At this moment, I have a VSTO add-in fulfilling my requirement. But it needs to run with Visual Studio or installed. Ideally, I want to have a Word file containing this VSTO add-in and put this file on my server so that user can use my add-in just by downloading this file, no need to any extra work. Is it possible?
Any help would be appreciated.
A VSTO project must be installed, whether it's an add-in or a document-level customization. Installation ensures that the correct version of the .NET Framework and other pre-requisites are installed. It also includes the user explicitly trusting the solution.
If you want something that distributes with a document then you need VBA, embedded in the document and saved as a *.docm file. Note that this file type will trigger macro security - some people will have settings that won't allow VBA to run. Some will have settings that can allow "trusted" and/or signed projects to run (you can research that).

What needs to be done in Install shield Project to make it capable to uninstall Word Add-In if it is already installed

I have two projects as mentioned below.
VSTO Project(Word Add-In)
Installer (.ism) project to create installer for above word add-in
Recently, I have made some changes in above both the projects to replace old brand name with new brand name.
After these changes, installer does not uninstall already installed add-in and instead it installs second instance of add-in(having different product name). Earlier, it was able to uninstall existing word add-in.
Please note that I have not changed Product Code and Upgrade Code in ism file.
Now, I want to make installer (created using Install Shield project) capable enough to uninstall existing word add-in (having old product name) if it exists.
The word Add-In is being used by our many clients and after re-branding we want them to re install Add-in. We don't want them to manually uninstall existing word add-in. So, we want to make changes in installer so that it auto detects existing add-in and uninstall it and then install new one.
I am new to the install shield and don't know what is the best and simple way to achieve this.
I am not familiar with the latest iterations of InstallShield, but at a minimum you can call vstoinstaller.exe to remove it at the start. It's usually in C:\Program Files (x86)\Common Files\microsoft shared\VSTO\10.0.

SolidWorks custom addin upgrade not working

I made a SolidWorks Addin using VB 2015. It works fine on SolidWorks 2015 but does not work on any higher release for SolidWorks (e.g. 2016, 2017). Not sure what I am doing wrong as these addins should not be release specific.
Any Help Would be greatly appreciated.
Thanks,
Pranav
This happens for a couple of reason, always associated with where the COM Interop files were and are now on your system.
The first is if you referenced the exposed COM that is available when you install SolidWorks from the screen below. This always created problems when the old version of SolidWorks is uninstalled or upgraded. Your projects will show a warning within the references in your project.
The second often happens when you reference the Interop dll from the installation location (usually C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\api\redist\SolidWorks.Interop.sldworks.dll). This is what the SolidWorks Addin Template does by default. Sometimes if you forget to remove the SolidWorks installation directory when installing a new version of SolidWorks, it creates a folder with a different name (SOLIDWORKS Corp\SOLIDWORKS (2) by default). The problem is now the referenced dll file's path has changed and your project can no longer find it.
The best way to solve these issues is to create a copy of the dlls you want to reference in your project's folder structure and browse to them within your project like below.
Doing this will ensure that your project always references this dll, that shouldn't be removed or have its path changed regardless of what you do with your SolidWorks Installation.
If for some reason the addin template does reference this location, go to your references in the Project Explorer, and remove them, and re-point them to a local copy (not the installed files).

Difficulties using Windows Installer to Deploy a COM Add-In

I created a COM Add-In in Visual Studio 2012 and when I compile and run it on my machine, it works perfectly. The problem arises when I try to use the Windows Installer I created to install the Add-In. I am trying to install this Add-In to multiple machines and I would like to figure out that the issue is with the installer.
When I try to call a Sub from the COM Add-In with Excel, it throws a 'Subscript out of range' on the second line. The Sub connects to a SQL server, performs a query based on cell data, and returns the result. I looked at the Add-Ins in Excel, it is installed and not inactive/disabled. This same code works perfectly if I compile the project on my machine, just not when I install the Add-In with the installer.
Dim com as COMAddIn
Set com = Application.COMAddIns("SQL") <----
com.Object.ConStr
I followed this guide for the installer:
https://msdn.microsoft.com/en-us/library/Cc442767.aspx
I did the following to get the installer running (just a summary of the above article):
Added the Primary Output, .vsto, and dll.manifest files to the
application files
Added .NET Framework 4.5 (full) and Visual Studio 2010 Tools for
Office Runtime as prerequisites
Set the INSTALLDIR
Specified that the application should deploy to the current user
Told the installer to create the following registry path
HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins\JACOB.SQL
Created the following registry keys
Description SQL
FriendlyName SQL
LoadBehavior 3
Manifest file:///[INSTALLDIR]SQL.vsto|vstolocal
Set the Build to SingleImage
Set the InstallShield Prerequisites to 'Download from the Web'
Set the Active solution configuration to SingleImage
Set the Configuration of the installer to SingleImage
Built the Installer
I made sure to uninstall the compiled version of my project from Excel then went to the following file path and ran setup.exe.
%Visual Studio 2012%\Projects\SQL\Setup1\SQL_Setup\Express\SingleImage\
DiskImages\DISK1
After the installer completed, I ran the same code as above and it returned a 'Subscript out of range' error. As I said earlier, the same code works if I compile the code.
Dim com as COMAddIn
Set com = Application.COMAddIns("SQL") <----
com.Object.ConStr
I have researched what the issue may be and have come up mostly blank. I have found that I may need DllRegisterServer/DllUnregisterServer methods to add my dll to the registry with Regsvr32, but I have no idea how to write these methods. I also don't see how this could be the issue if the compiled project works without these methods. Maybe the installer skips a step?
Any help would be GREATLY appreciated. Thanks!

Installing VSTO Outlook addin for All Users to drive other than C: results in Microsoft Office Customization Installer dialog

First let me get this stuff out of the way:
This happens with my own addin, as well as another third party VSTO add-in, so I don't think I'm doing anything incorrect
.net 4.0. VSTO runtime 10.0.50701
Windows 8. Also tried Windows 7
I am using the |vstolocal suffix in the HKLM registry for the addin
I have also tried adjusting the 'program files' paths in the registry here: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion to point to my new 'F:' location, and that didn't change any behavior
Here are the steps I'm taking:
Create a new volume on a separate disk other than C:. I called mine 'F:'
Add the program files structures F:\program files and F:\program files (x86)
Install your VSTO addin (I'm using Outlook but it will happen with Word too) to "F:\program files (x86)" instead of the 'C:' drive
Launch Outlook.
Result is this dialog:
According to this, I shouldn't be getting this since its an all users install (see the Inclusion List section):
Is this a Microsoft issue? I realize I can add to the Inclusion myself however then I would be subscribing to more of a per-user approach, and that seems like a bad approach. Is this coming up because anything other than the 'real' program files folder cannot really be trusted by VSTO loader?
The dialog window belongs to the ClickOnce installer. But the link goes to the Windows Installer section in MSDN.
It is up to you where to install the add-in, there is no need to use the Program Files folder.
Make sure that you did all the steps described in the Deploying an Office Solution by Using Windows Installer article. It describes all the required steps for creating add-in installers.
I recently went through the same thing, i got this when i just published the vsto from vs2015. I tried using installshield, yielded the same issues, eventually i switched to wix installer, now i don't have any update checks running and its a clean install. These are some customization updates and our client actually had a firewall blocking it so the install failed. Try wix it worked great for me. Hopefully you don't end up with my current issue of not seeing the add-in if i am not running outlook as Administrator, driving me nuts, good luck.