Click here to Skip to main content
15,921,542 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am creating an Excel Add-Ins for Office 2010. Earlier i was doing code in Visual Studio 2010, .net framework 3.5 on ThisAddIn_Startup like

private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
this.Application = (Excel.Application)Microsoft.Office.Tools.Excel.
ExcelLocale1033Proxy.Wrap(typeof(Excel.Application), this.Application);

CreateCommandBar();
}
But now the project is shifted on .net framework 4.0 then ExcelLocale1033Proxy is obsolete here.

What should i use here? Please guide.
Posted

1 solution

Unfortunately, you will have to let go of ExcelLocale1033Proxy.

Projects that were created by using Microsoft Visual Studio 2005 Tools for the Microsoft Office System instantiate the Excel Microsoft.Office.Interop.Excel.Application object by using the Microsoft.Office.Tools.Excel.ExcelLocale1033Proxy class. This class has been removed from the portion of the Visual Studio 2010 Tools for Office Runtime that’s used for solutions that target the .NET Framework 4 or the .NET Framework 4.5. Therefore, you must remove or comment out the line of code that references this class.

Just we have to remove ExcelLocale1033Proxy to initialize the Application. There is no need to do this in upgraded framework like .net framework 4.0 and above. This is already initialized.

Reference : http://msdn.microsoft.com/en-us/library/vstudio/ee712587.aspx
 
Share this answer
 
v2

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



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