We have a large project which builds fine on several machines. I am in the process of installing a development system on a new machine and have a problem building because the Microsoft.Office.Interop namespace is missing.
I have Office 2010 installed and have installed the PIAs. I have removed/re-added the Office references in the project - they still seem to have the yellow triangle.
Still no luck.
Could there be anything I haven't tried yet?
Sounds like you're doing something wrong while adding the reference. You could see to these similar threads if they are of help:
https://stackoverflow.com/a/16054365/1493524
PIA's Installed but still receiving interop error
Adding Office 2010 Interop (PIA) in Visual Studio 2012
Related
I'm coding one of my first projects in Visual Studio 2017 using the Microsoft Office Interop Tools to basically open some Word files, extract some content and export it to an XML file.
I know that on the target machine Office should be installed and actually on that PC a 2010 installation is licensed, while on my PC I have a 365 suite.
The first build was working only on my PC, with missing references errors to the interop library on the production PC, so I've downloaded the Microsoft Office 2010: Primary Interop Assemblies Redistributable
https://www.microsoft.com/en-us/download/details.aspx?id=3508 to include as a reference in my project, replacing the 2016 one.
First difficulty was: Once installed I cannot find the files on my drive, nor a reference inside visual studio, nor in the documentation. Is there any info about where to pick the dll?
So I unzipped from the cab the WORDPIA.DLL on an handy directory and referenced it in my project.
While is it working locally, it isn't yet on the production PC.
I'm sure I'm missing a lot of points on this topic, VS & C# are not my territory, but I need some tips to finish the project.
Go back to the original project (or reference the version of the PIAs installed on your machine). The redistributable is intended for installing to an Office 2010 machine where the PIAs were not installed. It's not meant to be used in the manner you envision.
Now click each "interop" reference entry and look at the Properties window. There should be a setting for "Embed Interop Types". Set that to True. This should make the project version-independent as it will contain the PIA information your project uses.
Note that "embed interop types" was introduced with .NET Framework 4.0 and is not available for earlier versions of the Framework. If an earlier version is a requirement, then you have to use late-binding or develop your project using Office 2010.
I have a Word VSTO application (.net 4.6.1) that I am installing via an InstalShield installer. It works fine on all the computers I've tested it on so far, but one particular computer is having problems trusting the vsto. It installs with no issues, but when run, the customization aren't there and we get an error in the event viewer saying
"the manifest may not be valid or the file could not be opened"
I've researched this and all the answers seemed to point to it being an issue with .NET 4.0 not trusting SHA256. However, the computer have the problem is a Windows 7 computer, with .NET 4.6.1 installed. I even installed 4.7.1 and still get the issue.
Are there any other reasons for this error that I can look at? I am using Visual Studio 2013 with InstallShield to create the build and sign the assembly with a third party certificate. I've actually tried signing it in SHA1 with a test certificate created from visual studio and it still gives the error.
I figured out the solution. We had to install the Visual Studio 2010 Tools for Office Runtime on the computer with the issue. After that the vsto worked. worked.
Since 3 days I've been trying every link I find on the issue, but always get the "CS0234: The type or namespace name 'Office' does not exist in the namespace 'Microsoft'" error. I need to convert Excel to PDF in c#.
This is my set-up:
Windows Server 2012 R2
Office Professional Plus 2010 (in Spanish! That should not be a
problem though?!)
Microsoft Office 2010 Primary Interop Assemblies
Microsoft Visual Studio Express 2015 for Web
I won't see Microsoft.Office.Interop.Excel among the Assemblies under .NET; trying to find a way, I added the "Microsoft Excel 14.0 Object Library" to my project which made the "Microsoft.Office.Interop.Excel" reference at least appear in the list. But that dll points to C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Excel\14.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll and seems to be useless as the error remains. I reinstalled everything several times and updated VS Express for Web from 2013 to 2015.
I read somewhere (Can I still use Microsoft.Office.Interop assemblies with office 2013?) that PIAs are considered a historical artifact and that one can do without. That was only more confusing and didn't help.
I have a very old Visual Studio Excel AddIn project.
When I compile it on my machine on VS2013 (.Net 4.0) and Office 2010 it works perfectly on the other machines. But when I compile it on TFS machine (no Office, only the vsto_redist.exe) it does not work - it does not load.
I've tried to switch on the VSTO_LOGALERTS and VSTO_SUPPRESSDISPLAYALERTS but this did not show any errors.
I've also tried to add a Microsoft.Office.Interop.Excel.dll to the project it still does not worked.
Any help on how I can see the problem will be helpful.
You need to install at lest the Excel developer tools that cinder in the box with office.
I've been tasked to work on an existing .Net 2.0 Visual Studio 2012 project which contains a reference to Microsoft.Excel9.Interop, but the reference is throwing undefined errors on my machine.
I haven't been able to find anything in my research about how to solve this error or where I can find Microsoft.Excel9.Interop dll.
Does anyone have any experience with Microsoft.Excel9.Interop that can point me in the right direction?
Thank you.
You have to install, in this order:
Microsoft Office
Visual Studio Tools for Office which installs the PIA's, this installs all the assemblies you need
Are you sure you are looking for version 9? This is for Office 2000.