Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to create my first Excel add in with c#. I have Visual Studio 2010. I created a new project using the new project/c#/Office/2010/Excel 2010 Addin. It creates an event handler for this.Startup and this.Shutdown but I get an error that there is no definition for Startup or Shutdown. There is also a warning that Microsoft.Tools.Common.v4.0.Utilities is missing. I looked through all the .NET references and cannot find it. Where can I get it or what other reference will work?

What I have tried:

I have searched for the .dll using Google and have not found it.
Posted
Updated 27-Feb-16 5:37am

I wonder what strange words you gave to Google; the first hit I got was Assemblies in the Visual Studio Tools for Office Runtime[^].
 
Share this answer
 
Comments
Fred Andres 27-Feb-16 11:26am    
I did find that page on my first search. My problem is that I don't find Microsoft.Tools.Office.V4.0.Utilities in my list of .NET references so I can't add it to my project. The Visual Studio automatic project builder tried to add it and couldn't find it. I followed the link to download Microsoft.NET Framework 4 and I get an error message saying that I already had a higher version installed. I did find Microsoft.Tools.Office.V9.0 and tried adding that reference. I still get the same error that there is no definition for .Startup or .Shutdown
Richard MacCutchan 27-Feb-16 11:38am    
You need to download the tools dlls, they are not part of the .NET framework.
Fred Andres 27-Feb-16 12:51pm    
I spent a half hour searching the link you posted above and cannot find the tools dlls download. Can you possibly provide a direct link to the download I need?
Richard MacCutchan 28-Feb-16 2:58am    
I spent less than a minute with Google to find https://www.microsoft.com/en-GB/download/details.aspx?id=48217.
C#

C#
#region VSTO generated code

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
    this.Startup += new System.EventHandler(ThisAddIn_Startup);
    this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}

#endregion

This is the automatically generated code which is causing the error
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900