C# .NET - Excel 2003 add-in made in VS 2008 not working on client machine

Asked By Vermeet
25-Aug-11 12:48 AM
I made an excel 2003 add-in in Visual Studio 2008 to work on both Office 2003 and Office 2007. The addin works fine on excel 2003 on devlopment machine but it doesnt work on deployment machine. There is com addin load error on client machine. 
  James H replied to Vermeet
25-Aug-11 12:52 AM
Hi please refer this link which sounds like your problem
http://social.msdn.microsoft.com/Forums/ar-SA/vsto/thread/22a78834-9599-4da9-bc88-05bea1fa9869
  Vickey F replied to Vermeet
25-Aug-11 12:54 AM

The feature-rich technology of Add-in Express for Office and .NET makes COM add-ins / plugins development quick and easy.

Add-in Express implements everything required by the supported technologies and you concentrate on the applied code only. You write the code in Visual C#, Visual C++ .NET, Visual Basic .NET.

Follow this links also-

http://www.add-in-express.com/add-in-net/com-addins.php
http://www.codeproject.com/KB/COM/excelnetauto.aspx

here you will get example

  aneesa replied to Vermeet
25-Aug-11 01:13 AM

Just in case you haven't checked the trust settings, this http://msdn.microsoft.com/en-us/library/bb386131.aspx describes how to.

I came across this on a MSDN forum:

For the repair to work, you'll have to run the VS Command Prompt with Admin Priviledges (right click, run as administrator). Then run this command line:

C:>AddinUtil -AddInRoot:"%CommonProgramFiles%\Microsoft Shared\VSTA\AppInfoDocument" -Rebuild

If it still doesn't work, you may also have a corrupt pipleline store, which can be fixed like this:

C:>AddinUtil -PipelineRoot:"%CommonProgramFiles%\Microsoft Shared\VSTA\Pipeline" -Rebuild

You'll get one warning from that command but that is expected.

Failing that, I think you will have to run a repair on the Visual Studio 2008 installation (put the installation DVD in a drive, and select the repair option

  Reena Jain replied to Vermeet
25-Aug-11 02:06 AM
HI,

You seemed to be interested in ClickOnce deployment, however the link provided above points to Windows Intaller. To learn about deploying office solutions on end user machines look http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/1666d2b0-a4d0-41e8-ad86-5eab3542de1e.

Also, if your addin does not load for some reason, follow http://msdn.microsoft.com/en-us/library/ms269003%28VS.80%29.aspx instruction to debug the issue.

Feel free to follow up if these do not help you resolve the issue.

  Anoop S replied to Vermeet
25-Aug-11 02:42 AM
what is the exact error you are getting?
Make sure that all dll and dependency files are placed in deployment machine
  Vermeet replied to Anoop S
25-Aug-11 03:45 AM
I m not getting any error , just my add-in doesnt appear in the COM addins on the client machine.
  Anoop S replied to Vermeet
25-Aug-11 04:48 AM

1.     Make sure your add-in is installed correctly and it is enabled

Open registry editor and navigate to “http://support.microsoft.com/default.aspx/kb/291392”. Here is how this registry key looks like after I installed MyExcelAddin:

The registry string we are interested in the most is the LoadBehavior. Whenever you see "3" (Loaded at Startup) as the value of this string you are good in this part and your add-in tries to load when the Excel starts. For more information about registry entries for application-level Office solutions see http://msdn.microsoft.com/en-us/library/bb386106.aspx.

2.     Check out “COM Add-Ins” dialog in Excel

Now open Excel and see if your add-in loads successfully. If not, open Excel Options dialog (File->Options) and navigate to Add-Ins tab.

 

“Healthy add-ins” show up as “Active Application Add-ins”, however, if an add-in is disabled for whatever reason, it will appear under the “Inactive Application Add-ins”. You can select the “COM Add-ins” from the Manage dropdown at the bottom of this dialog and see the LoadBehavior of all COM add-ins. In normal cases, the add-in should be checked and its "Load Behavior" should be “Loaded at Startup”:

If the VSTO runtime encounters a problem loading the add-in, you’ll see this message instead.

“Load Behavior: Not Loaded. A runtime error occurred during the loading of the COM Add-in”.

3.     Find the problem

Set the "VSTO_SUPPRESSDISPLAYALERTS" environment variable to 0. Then go back to the registry key I mentioned in step 1 and set the LoadBehavior to 3. Now restart the Excel. You should be able to see a dialog describing what is happening:

 

It is also a good practice to enclose the code inside the add-in's startup event in a try-catch block and log all exceptions.

 4.     Hard disabled add-ins

If an add-in causes the Office application to crash (close unexpectedly), the add-in gets “hard disabled”. Please follow http://msdn.microsoft.com/en-us/library/ms268871.aspx instruction to re-enable the add-in. In addition, you might want to check the “HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Resiliency\DisabledItems” (replace 12.0 with 11.0 for Office 2003 and with 14.0 for Office 2010). Your add-in should not have an entry under this registry key.

More References:

  • http://msdn.microsoft.com/en-us/library/ms269003.aspx
  • http://blogs.msdn.com/b/vsod/archive/2008/04/22/troubleshooting-com-add-in-load-failures.aspx
  • http://blogs.msdn.com/vsto
  • http://social.msdn.microsoft.com/Forums/en-US/vsto/threads
  Vermeet replied to Anoop S
26-Aug-11 01:08 AM
Thanx all for your replies, but my addin's problem is that its Load Behavior changes from 3 to 2 when i open my excel application. I have tried changes in set security project to grant full trust.
  Anoop S replied to Vermeet
26-Aug-11 04:14 AM

When you build your add-in on the developer machine, VSTO deploys registry entries and it also deploys Code Access Security (CAS) policy. The setup project by default includes the same registry entries, so these will be deployed when you install the add-in. However, the setup project does not include any CAS settings, so you need to set this up yourself.

The article you quote does walk you through how to addd custom actions to your setup project so that the CAs entries are made when you install the add-in. For a full description of the security requirements for all VSTO solutions, you should read the series of documentation starting here:

http://msdn2.microsoft.com/en-us/library/6exya3kf.aspx

The simplest thing you can do on the target machine to check that security is in fact the reason for the add-in not loading is to run caspol on that machine. For example, you could run this commandline to grant FullTrust permissions to the folder where the add-in is installed and the folder contents:

caspol -u -ag 1 -url "C:\Program Files\Microsoft\MyAddin\*" FullTrust

(obviously, substitute the real path for the dummy path given above). Note that this is the simplest security you can apply, it is not the most secure - you should read the articles quoted above to determine the right security to apply for your requirements.

As to the LoadBehavior entry in the registry, this should be set to 3 if you want your add-in to load. When Office attempts to load the add-in, if this fails for any reason, it will reset this value to 2.

Create New Account
help
visual basic what r the vb .net features?. . . . . . . . . . . . . . . . . . Visual Basic .NET provides the easiest, most productive language and tool for rapidly building Windows and Web applications. Visual Basic .NET comes with enhanced visual designers, increased application performance, and a powerful integrated development environment
MSLU and Visual Basic Net Windows 7 Hello, I use Visual Basic Net 2003 / Net Framework 1.1. I need in my win application implement Microsoft Layer for Unicode (MSLU), but I don't know how to impement it in Visual Basic net. Please could someone help me to use MSLU in Visual Basic net? Thank
Opening excel 2000 files from Visual Basic .NET .NET Framework Hi! I need to crete a visual basic .net application to read Excel 2000 files. Does anyone know if I need some kind of driver or some extra file to be able to do it? Thanks a lot! VB.NET Discussions ADO.NET (1) Excel (1) Visual (1) No special driver needed - Excel supports OleDb
Visual Basic.NET and the .NET Platform Visual Basic.NET and the .NET Platform [aPress] By Peter A. Bromberg, Ph.D. Printer Friendly Version Peter Bromberg Andrew Troelsen
New to visual basic.net .NET Framework Hi, everyone I'm new to visual basic.net thats why i need all the help that i can get I'm using visual basic 2005 express edition. I just want to know how can i show and change