Excel addin deployment problem - vsto

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

Related

Resume Opening Workbook After Addin Interrupts

I've written an Excel addin that periodically checks a remote repository for data updates, including a check when the addin loads at Excel start up (during the addin's Workbook_Open event). If new respository data is detected, the addin asks the user for permission to proceed with the update. If the user clicks "yes", the addin successfully updates itself and everything is happy... except...
If Excel is not already running and the user selects an Excel file to open (e.g. via double-click in Windows), this sequence of events occurs and everything works, but the user-requested file opening is interrupted and not re-engaged. The Excel app is running, but with no workbook loaded (the workbook area is an empty frame).
I believe I have two options, neither of which I know how to accomplish:
Prevent the addin from completing its update check until the user-selected file has completed its open sequence and is fully loaded, or
Allow the addin to update itself and then somehow re-engage the user-selected file to complete the file open/load.
I have not been able to discover the filename/path of the user-requested file, so my addin isn't able to direct that file to be loaded.
My current workaround is a MsgBox telling the user to close Excel and re-open the selected file. Ideally, the addin update should occur and the original action should complete without requiring user intervention.
(Building on Option 1, I could start a delay timer for the addin to check for updates XX number of seconds after Excel starts, but this seems kludgy to me.)
Any guidance or ideas are appreciated. My interwebz searches aren't hitting the right combination of keywords for the exact scenario.
Instead of opening the new addin update file immediately you can use OnTime to delay it which should allow the other file to open successfully. See here: Process for updating Excel add-in?
In the answer you'll also see a reference to this package here which does everything you need. Autoupdates are hard so I would recommend going with someone else's solution.
http://www.decisionmodels.com/downloads.htm#addload
(Scroll down to Add-In Loader Version 2)

Excel custom Add-In not loading when instance of Excel is opened by another application

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.

Listview on worksheet generates cannot insert object error Excel 2010

Hi I have an Excel 2003 application which has a listview embedded in the worksheet. It no longer works on Excel 2010.
I re-registered the ocx using regsvr32 C:\Windows\System32\MSCOMCTL.OCX as per advice.
This works for listviews on forms, but not for the worksheet.
Microsoft advises that Cannot insert object can be generated if the control is form specific and an attempt is made to add to the worksheet.
Can the listview be used in Excel 2010 on a worksheet
If so how?
Otherwise a rewrite will be required.
That happened to my Excel files using ActiveX or any sort of automation. The solution was confused at the beginning but the following link will help you.
Create a batch to remove cached control type libraries (extender files *.EXD) files from Windows
Opening each of the projects (Excel with macros)
Switch the file to design mode
Open VBA Code (Alt-F11) to edit any module and press from the main menu > Debug > Compile VBAProject
Switch back to Run Mode
Save and Close File
Reopen the file & test
Form Controls stop working after December 2014 Updates

Word 2007 add-in for a custom ribbon - ribbon not visible in the saved document

I have a requirement where I need to have a custom ribbon added to the Word 2007 file which will be populated from some items. I created a add-in using this and pressing F5 opens Word file contains the newly added custom ribbon. But I save that word file and open that again and It does not have that newly added custom ribbon. I am sure I am missing something here.Could anybody throw some light?
I save that word file and open that again
Are you opening it again outside of the Word instance running from Visual Studio? Your add-in might only be available when you're debugging the project.
Check if an entry for your add-in exists in the registry, under:
HKLM\Software\Microsoft\Office\Word\Addins\.
If no entry exists, I've found that the easiest way to deploy a VSTO add-in to your machine is to create a setup project for it in Visual Studio.

Deploy Outlook UserForm

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