1

I am writing an application that do Excel 2013 Interop.

My first step was to add the reference using the add reference > com panel. But the build on my jenkins failed because Office is not installed on the server.

It is out of the question to install Office on the server but I looked for Office 2013 PIA (like suggested on this post and so many other on the internet), but I could not find it.

So I ended up installing the nuget package for it. It was fine except that it does not install the Microsoft.Office.Core dll required for example to add picture to a worksheet... And I need that feature...

  • Do you know where I can find the Microsoft.Office.Core.dll or the Office 2013 PIA?

  • Or do you have any other solution that could do the trick without rewriting all the code that currently works?

Community
  • 1
  • 1
fharreau
  • 2,105
  • 1
  • 23
  • 46

3 Answers3

1

Recommend you to use OpenXml, which is easy-to-use and will not require you to install Office.

Almett
  • 876
  • 2
  • 11
  • 34
  • That's an option I would like to avoid but I keep it in mind if I cannot figure it out. – fharreau May 02 '17 at 15:44
  • @fharreau As you may know `Excel.Interop` doesn't work without Office.So it is going to be a problem.You definitely should use OpenXml. – Almett May 02 '17 at 15:48
  • Or another library, like EPPlus – Magnetron May 02 '17 at 15:58
  • @AlimjanMettursun > Even if I agree with you, this is not the point of my question. I am stuck with Interop for now. Also, I am certain that all users of the application do have Office installed on their computer. – fharreau May 02 '17 at 16:11
0

You could add agents (one or more) that are Windows machines with the necessary libraries installed, then configure the master node to only run builds that are specifically assigned to it.

Then you don't need to install the Excel 2013 development environment on your server, and your build environment will more closely represent the user environment.

Refer to How to set up new Jenkins slave (where "slave" is the out of favor term for an agent)

Community
  • 1
  • 1
Mark Waite
  • 1,351
  • 11
  • 13
  • I can install the Excel development environment on the server as long as I do not install the whole Office. My problem is I can't find the 2013 version of the PIA ... – fharreau May 03 '17 at 07:45
  • If the 2013 version of the PIA is not available for server, then isn't it simpler to install the 2013 version on a Windows desktop machine, then use that Windows desktop machine as a build agent? – Mark Waite May 03 '17 at 15:03
  • What are you talking about ? Office development tools or the full Office 2013? Whether I install Office on a server or a classic windows, it is the same problem, I don't want to. – fharreau May 03 '17 at 15:48
  • My apologies, I had misunderstood. I thought you were not allowed (by software limitations) to install Office on a server. Instead, you're saying that while it is allowed, you don't consider it an acceptable solution to your problem. I don't have any other help to offer. The simplest solution (to me) seems to be to install Office on a machine that will be used for the build. – Mark Waite May 03 '17 at 16:29
0

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution. Read more about that in the Considerations for server-side Automation of Office article.

As a possible workaround you may consider using the Open XML SDK if you deal with open XML documents only, see Welcome to the Open XML SDK 2.5 for Office. Or just any third-party component designed for the server-side execution (for example, Aspose).

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • 1
    My application is a WPF application that run on client computers having Office installed. I just want to build it on my CI server, not run on it or any server-side context. – fharreau May 04 '17 at 09:10