I have a Visual Studio project that is an interactive Windows forms application to import data from an Excel file.
In the process of upgrading the project from VS 2008 to VS 2013, from .NET 2 to .NET 4 and changing the reference Microsoft.Office.Interop.Excel from pointing to an 'Office12' folder to an 'Office14' folder to get the latest and greatest Excel features, I got the following error:
Reference to class ‘ApplicationClass’ is not allowed when its assembly is linked using No-PIA mode.
This was due to one of the files having the following line:
Inherits Microsoft.Office.Interop.Excel.Application Class
Apparently, for .NET 4 and Visual Studio, the default action is to set EmbedInteropTypes to TRUE when I removed and added the updated reference Microsoft.Office.Interop.Excel.
Is there a way in Visual Studio to set EmbedInteropTypes to FALSE for this reference without editing the .vbproj file outside of Visual Studio? Or, should I be doing something differently to resolve this error?
Even after a manual edit of the .vbproj file, I am getting the warning '... is not CLS-compliant because it derives from 'ApplicationClass', which is not CLS-compliant. How do I resolve this warning or can I ignore it?