I made a userform to give out to colleagues.
The installation procedure goes approximately like this:
allow unsigned macros
open VB Editor
add 2 references by manually navigating to the .ocx / .tlb files (needed for Treeview control)
import form
create a new module
copy a procedure into that module (hook for button, contains essentially MyForm.Show)
run another proc to create toolbar button
save, restart
My plan was to make an install script; but I found Outlook's VBProject is sealed tight against any automated access.
How can I make that installation procedure simpler?
As microsoft wrote here:
https://support.microsoft.com/en-us/help/290779/managing-and-distributing-outlook-visual-basic-for-vba
If you are developing a solution that you intend to distribute to more than a few people, you should convert your VBA code into an Outlook COM or VSTO add-in or an Office add-in for Outlook.
Outlook macros are not made to be deployed so you will always have troubles deploying them to users as they will need to make too much actions as you described.
To avoid that, I recommend you to look at VSTO add-ins and ClickOnce. Here are the links:
VSTO
https://learn.microsoft.com/en-us/visualstudio/vsto/getting-started-programming-vsto-add-ins?view=vs-2019
ClickOnce deployment
https://learn.microsoft.com/en-us/visualstudio/vsto/deploying-an-office-solution-by-using-clickonce?view=vs-2019
Related
I'm trying to create my first Excel Add-In for Excel 2010. Most of it is working, it's running from the ribbon buttons, but I'm having trouble addressing the Add-In's subroutines from my workbook's VBA code.
According to this answer on SO, it should be possible to simply use the syntax:
mySub
or
Call mySub
But this causes the error "Sub or Function not defined". I've only managed to run them this way:
Run "mySub"
or
Application.Run("myAddIn.xlam!mySub")
Is there a way to include the Add-In so I can address it the easy way?
The Add-In is already checked in the Tools->Add-Ins list, and has a unique name (CalcFunctions) which is different from its file name (CalculationFunctions.xlam). The Add-In file is on a different disk and I'm working on a server, but I don't expect that that matters.
(Posted on behalf of the OP).
Turns out I'm just dumb. I only set a reference to the Add-In in the regular Excel window. I assumed that was what people meant by Tools->References->Add-Ins (I use Excel in Dutch and there's no "Tools" menu). Anyway, the solution was setting a reference in that menu in the VBA editor window.
Here's how to add a reference in VBA:
ThisWorkbook.VBProject.References.AddFromFile refPath
With refPath being the full path to the file.
To be able to add references you need to have permission to edit the VBA project. You can enable this in excel settings->trust center->macro settings. If you're on a company pc it's likely the administrator has to set these settings for you.
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.
I have written 2 Macros in PowerPoint and added the Macros to a customized ribbon named 'My Ribbon' to make those macros available at a click of a button. The only problem is the Ribbon disappears when someone else opens the PowerPoint on a different computer. The macros stay with the file but the customized ribbons do not and we have to create another customized ribbon, and place both macros to the ribbon every time we share the file across our drive.(Which is quite annoying)
I want to permanently append the customized ribbon to the PowerPoint so that anyone who opens the PowerPoint will be able to see the personalized ribbon with both Macros already on their version of PowerPoint.
VBA macros are not designed for distributing the code on multiple PCs. If you need to get a solution which can be installed on other PCs you need to develop an add-in. That's exactly they were invented for. Moreover, you can create an installer for the add-in. It will be installed as other applications on your PC. See Walkthrough: Creating Your First Application-Level Add-in for PowerPoint to get started.
If you choose to stay with VBA macros, you will have to edit the open xml document. See Customize the Word Ribbon User Interface for more information. The process is common for almost all Office applications (Outlook does't support that).
You could use such a program like Ribbon Editor to customize the Ribbon for your pptm file only. (No need for an AddIn it you want it deployed only with the file)
I have been working on an add-in with some short-cuts for PowerPoint 2010.
I am able to make the add-in "tab" so that I can access my macros from PowerPoint after installing the add-in.
However, I cannot add the macros to my Quick Access Toolbar, or otherwise create shortcuts.
This creates a need to use a very extensive key combination to access the add-in shortcuts, eliminating part of the rationale behind them.
Is there any way to make PowerPoint macros that I can then link to the Quick Access Toolbar?
I have created Excel addin.
Addin will never check for updates, User will update the addin.
Excel is launched from the c# application, after launching Excel uses addin to perform actions.
The problem is sometimes though Excel has updated version of the addin still it shows the "Updating Office customization" dialog box and will create the directory in AppData\Local\Apps\2.0 folder.
Why Excel is updating the customization though its having latest version of the addin.
i assume you are using VSTO, from which .NET version?
check the publish section of the project properties... on the "Updates" button, you should see the 3 options for an excel addin to update itself.
if you select the check whenever the addin is being executed. the Excel will check for an updated version every time.
now you haven't say if excel will actuall update the add in version or not. but please check the above first