Outlook 2007 Addin - LoadBehavior in registry always resets to 2 - visual-studio

I know this has been asked before, but I've never found a solution to this. I created an Addin in Visual Studio for Outlook 2007. I created an Installer and copied the files and created the registry values. It installs perfectly on the developer computer and it uninstalls perfectly as well. But on the second computer, which is also Windows 7 32bit and Office 2007, the registry key LoadBehavior is always reset to 2 when Outlook opens. I edit it to say 3 and it just resets to 2 again. No error message or anything. This also happened on my computer at work.
Now, I did read something about this guy that tried installing Visual Studio on the computer and it would run just fine after. Made me think I need some other .NET library or something?
Why does this happen and has anyone ever found a solution?

In my case this turned out to be caused by an issue in a license protection wrapper from a third-party vendor. The issue has apparently been fixed in more recent versions of that product (contact me in private if you need more details).
Also, watch out for message boxes shown during Outlook startup. Outlook is really sensitive to those and AFAICT it has only gotten worse with Outlook 2010, especially under Windows 7.
Also, see this question of mine for links to a MS blog entry about this.

Related

Outlook 2016 Add-In doesn't work for some users

We've created an Outlook add-in which integrates our custom CRM with Outlook. A command button is added to messages in read and compose mode. A function file is called on the button click.
The add-in manifest passes validation and installs properly on all machines. However on Outlook 2016 desktop (only) we are seeing an error on some machines. The exact error message says: “We’re sorry, we couldn’t access [NCS Outlook Add-in]. Make sure you have a network connection. If the problem continues, please try again later.” ([NCS Outlook Add-In] is the name of our add-in.)
Note that this message appears IMMEDIATELY after clicking the add-in command button. It does not first say “[NCS Outlook Add-in] is working on your request” like it add-ins do when an error has occurred.
We have tried Outlook logging and haven't found anything useful in the logs. We've checked settings and disabled other add-ins. We have also tested across machines with user accounts. The same user will have the error on one machine and not the other. In short, it seems that the error is machine specific and not profile related.
Version of Office 365 installed: 1705 (Build 8201.2209).
We experienced this exact behavior in Outlook 2016, the solution was to enable protected mode for the restricted and internet zones.
The easiest way to change this is in IE.
In Internet Explorer, click the Tools button, and then click Internet Options.
Click the Security tab, and then select the Restricted Sites Zone.
Select the Enable Protected Mode check box, and then click OK.
Restart Internet Explorer.
Here is a little more information:
https://support.microsoft.com/en-us/help/2761180/apps-for-office-don-t-start-if-you-disable-protected-mode-for-the-rest
Try this:
1) Close Outlook
2) Rename the folder C:\Users\%USERNAME%\AppData\Local\Microsoft\Outlook
to C:\Users\%USERNAME%\AppData\Local\Microsoft\Outlook.OLD
(Where %USERNAME% is current User Name.)
3) Start Outlook, Setup User Profile
4) Add/Test Add-In.
If that works, then something broken on old Outlook profile. But if same problem: Exit Outlook, delete the Outlook folder and rename Outlook.OLD back to Outlook.
I ran into this exact same problem after uninstalling Visual Studio 2015 on my development machine. (I had been using Visual Studio 2017 for Outlook add-in development.)
The problem went away as soon as I reinstalled Visual Studio 2017. The Outlook 2016 installation had nothing to do with the problem, I never changed Outlook or its profile at all.
This would indicate that the problem is somehow related to the SDK tooling on the machine...perhaps something to do with the .Net framework?
If I ran into this problem on a customer machine I would try reinstalling or repairing the .Net framework, or perhaps reinstalling Outlook (assuming it contains some add-in tooling that is broken.)
Just passing this on in case it helps anyone else.

Unable to register Outlook Add-in no matter what

I've been developing an Outlook Add-in, been working and installing fine.
Then I tried to installed a really old version of the same add-in (trying to verify some old behaviour, the old plugin was for Outlook 2010), and it somehow messed up the install/uninstall process. Ever since then Office Outlook 2016/365 is not able to register/view the Add-in anymore.
I've tried the following:
Uninstall and Reinstall Outlook
Removes all the registry entries related to the Add-in (I literally search with the Add-in's keyword and removed hundreds of left over entries which I wasn't even aware of)
Deleted c:\Users\user\AppData\Local\Microsoft\Office
Deleted c:\Users\user\AppData\Roaming\Microsoft\Office
Deleted c:\Users\user\AppData\Roaming\MyAddIn
Ran CCleaner
Ran RegDllView to scan all the registered DLLs, and it says C:\WINDOWS\system32\mscoree.dll is "missing"? But is there...
Tried to uninstall and reinstall Add-in Express before recompile the whole project.
If i try to manually add the Add-in in Microsoft Outlook, Options > Add-ins > Manage > Add, if i point it to MyAddIn.dll it would say that it is not a valid COM Add-in (but nothing was changed in the project on how the dll was built). If i point it to adxloader.dll and hit OK, it won't complaint but nothing shows under Add-in either.
My next option is to completely reinstall Windows, this is driving me insane. Can anyone who have experienced this insanity give me some pointers?
Operating System: Windows 10
Office: Office 365 Outlook

Outlook Addin starts up inactive

This is a very strange situation that I am in; scratching my head for answers.
I have developed an outlook addin that works perfectly on my dev machine and on about 90 % of the clients machines.
The load behavior of the addin is 3.
On 10% of the users, outlook starts up without loading the addin despite the load behaviour being 3. The user can manually make the addin active by going to the addin manager on outlook but after a restart this addin reverts back to being inactive bbut load behavior never changes from 3.
I used Install Shield LE to package this addin. I don't even know where to debug anymore, I tried changing different load behaviour values but still the same outcome. The addin just won't load on startup with this set of users.
The company uses ZenWorks to automatically install the addin on all the PCs from the MSI i generate using install shield.
One weird thing is, If i go to the installation directory of the addin and install the addin using the .vsto deployment file, it works and gets loaded on outlook (but thats makes it two addins installed).
I also checked the Resiliency section on the registry and the addin isn't there.
I have faced this issue. To solve this, you need to manually delete the registry entries from the following path.
Open registry editor and go to HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\Addins\<Your add-in> and change the LoadBehavior to 3.
If the above registry entry is not found, then look for HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\Office\Outlook\Addins\<Your add-in> and change the LoadBehavior to 3.
Go to HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Resiliency – remove the REG_BINARY keys found in DisabledItems and CrashingAddinList
where 15.0 is for outlook 2013.
If you are using 2010 outlook, replace 15.0 by 14.0 and for Outlook 2016 replace 15.0 by 16.0
Hope this helps.

Excel/VBA Automation Errors due to Office Service Pack 3.0 caused by Forms

After installing all latest windows updates my Excel VBA code is showing an automation error at the very start of the first module. It contains some forms as well as numerous modules of VBA code. However, when removing the forms (and associated code) everything is fine.
The same thing happened about a year ago after some other windows updates. Back then deleting the .exd files did the trick, but the current updates (including Service Pack 3) seem to be different.
What is going on and how can I get the forms to work? All the code is unchanged and has survived all previous windows/office updates. Running Windows 7 (same happening on Vista machine) and Office 2007.
I used to see this a lot with Visual Basic and Crystal Reports; either due to a bad deployment or DLL Hell.
So, my guess is that it's not the code but perhaps some 3rd party controls (OCXs, DLLs) you're using.
Check your References (In VBA IDE, click Tools and References) and to see where each DLL is pointing.
See if any of the dates on the libraries are different than a working machine and you may find the culprit.
Edit
The OP found the problem by following the steps above.
The fix for this particular issue is to unregister mscomctl.ocx:
regsvr32 /u mscomctl.ocx
Then register it:
regsvr32 mscomctl.ocx
Same issue here, problem completely solved after registering mscomctl.ocx!
for Windows 7 or 2008 - remember to run cmd.exe "as administrator", and then:
for 32bit Windows systems:
regsvr32 c:\windows\system32\mscomctl.ocx
for 64bit Windows systems:
regsvr32 c:\windows\syswow64\mscomctl.ocx
Same issue with VBA for AutoCAD. In my case, registering the new mscomctl.ocx with regsvr32 was enough to fix the issue.
We couldn´t solve the problem by re-registering mscomctl.ocx.
But we solved it by removing a "progress bar object form" wich calls mscomctl.ocx... We replaced it with application.statusbar.
Check out http://support.microsoft.com/kb/2687441 for an update that may fix this problem
We have the same problem. In our Add-In, we were able to trace the problem to a declaration of a variable as Excel.Application. The reference to this object is in the Excel.exe file, so it is very unclear as to which files got messed up.
The machines that have this problem were all updated early this morning (15 Aug 2012) with the following updates (sorry for not posting links, as a new user, I'm limited to only two per post):
Security Update for Microsoft Office 2007 suites (KB2596615)
Security Update for Microsoft Office 2007 suites (KB2596754)
Security Update for Microsoft Office 2007 suites (KB2596856)
Security Update for Microsoft Office 2007 suites (KB2687441)
Update for Microsoft Office Outlook 2007 Junk Email Filter (KB2687400)
Windows Malicious Software Removal Tool x64 - August 2012 (KB890830)
At present, we have not found any information on the MSDN site that could clear this up. We're still trying to isolate this down further.
I had the same problem. I got an unspecified error opening excel with my Add-In loading.
In the past, deleting the *.exd files in C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Forms\
did the trick, but not this time.
When I attempted to open up the forms in my addin, I got a different error and I could not open the forms.
I ended up rolling back to last night prior to the update and everything works again.
Same issue here today after performing the update for Office 2007 Excel. Oddly, one system had no issues despite the update - the newest system. So after some inspection, I noticed this trouble-free system had different version of MSCOMCTL.OCX in windows\sysWOW64 then others. Here are the details of this activeX
Size: 1,070,152 bytes
created: 6/3/2012
modified: 6/6/2012
product version: 6.01.9834
So I copied this to the trouble one and it did the trick.
Also, you might want to check if these application extensions are present in windows\sysWOW64 or windows\system32 for 32-bit system
FM20.DLL (Modified Date: 7/7/2011, version 12.0.6604.1000, 1.13MB)
FM20ENU.DLL (Modified Date: 10/24/2008, version 12.0.6413.1000, 32.3KB)
Not sure where you can download these. I cannibalized them from other systems.
Had the same issue on all of our terminal servers after one of the updates last night. Registering mscomctl.ocx fixed the problem for all users.
Un- and registering the MSCOMCTL.ocx did the trick for me:
Open an administrative-level command prompt. Click START, and type RUN in the run command line. On Windows Vista and Windows 7 you will
see CMD.EXE appear in the quick search list. Right click CMD.EXE and
left click Run As Administrator. A black command prompt opens.
If on a 64-bit machine, type the following: regsvr32.exe /u C:\Windows\SysWOW64\MSCOMCTL.OCX
Hit ENTER then type regsvr32.exe C:\Windows\SysWOW64\MSCOMCTL.OCX
If on a 32-bit machine, type the following: regsvr32.exe /u
C:\Windows\System32\MSCOMCTL.OCX hit ENTER then type
regsvr32.exe C:\Windows\System32\MSCOMCTL.OCX Your Office program
should work again after doing this.
Please see also: http://blogs.technet.com/b/the_microsoft_excel_support_team_blog/archive/2012/08/15/quot-unspecified-automation-error-quot-after-applying-ms12-060.aspx
son of a gun...I re-registered C:\Windows\System32\MSCOMCTL.OCX and everything works again. Thanks so much to all that pointed that out.

How do I set permissions on my VSTO outlook add-in?

I am trying to distribute my Outlook Add-In to the rest of the company.
I'm using Visual Studio 2008 Professional and Outlook 2003. In VS I used an installed template for Outlook 2003. It created a solution with BOTH a project and an installer.
I use the project and created an Add-In. It works GREAT on my PC in development. Now, I want to distribute it. Here's where things go haywire. The nice little installer they provide DOESN'T ACTUALLY WORK.
The installer runs and places the files where they are to go, but the add-in doesn't run. Instead it gets errors about not having permissions. The installer didn't automatically set the security settings for you.
No problem. You just have to set those settings... right? But no where can I find a simple list of those settings.
I've been to http://msdn.microsoft.com/en-us/library/bb332051.aspx a thousand times from almost every possible link on the web. I've read every Microsoft paper that I can find on VSTO add-Ins. Unfortunately everything seems to reference some magic script... "Just include the sample code..."
[rant] IF A SECTION OF CODE OR AN ENTIRE SOLUTION IS REQUIRED TO DISTRIBUTE YOUR CODE IT IS NOT SAMPLE!! IT IS REQUIRED !!! [/rant]
There. I feel better.
Since I installed VS2008, I don't have the directory:
C:\Program Files\Microsoft Visual Studio 2005 Tools for Office SE Resources\Samples
No problem, right? Just DL it from microsoft. I've downloaded every "vstor.exe" that I can get my hands on. They all offer to "repair or uninstall" my current installation, but no matter what I choose, the vstor.exe crashes.
HELP!!!
I just want to know what I need to do (the manual steps, if necessary!!!!!) to get my friggin app distributed.
No magic "include this gizmo". No fifty-thousand page diatribes.
Anyone know how this is ACTUALLY done?!
I got it to work.
I was able to get a "sample code" update from Microsoft that allowed me to follow the walk-through.
I still think that's utterly ridiculous to HAVE to use sample code to easily distribute your app. However it is working at the moment.
The link I used was given to me by anonymous use on a different board. Whoever you are THANK YOU!!!!
Here is the link I was given:
http://www.microsoft.com/downloads/details.aspx?familyid=6991E869-8D5B-45F4-91E7-B527BD236F4C&displaylang=en
This allowed me to actually get my hands on that mysterious "sample" code even though I use VS2008 Professional.

Resources