11

We want to use Microsoft.Office.Interop.Excel in our web application. Everything works fine on our local machines, but on our test machine we're running into problems. It has neither Visual Studio nor Office installed on it.
We're using .NET framework 2.0 and the server is running on Windows Server 2003 with IIS6.

Is there a dll that needs to be installed on the machine or added to the bin of the web application?

Lea Cohen
  • 7,990
  • 18
  • 73
  • 99

4 Answers4

11

You will need to have MS Office and the Office Interop assemblies installed on your server in order for that to work.

d4nt
  • 15,475
  • 9
  • 42
  • 51
  • 2
    Yes, in fact the interop assembly contains nothing but the type definitions and wraps the calls into the actual Office object model. – Dirk Vollmar Feb 19 '09 at 10:01
  • Oh I just started wokring an application which I was planned to use this dll for reading excel. So are you sure that this is not part of .net framework. Is there any workaround to use this dll, without installing MS Office on servers ? – kbvishnu Feb 26 '16 at 06:14
5

I'm pretty sure that you will need to have Office installed on the machine it's runnnig on. At least that's my experience from building desktop apps that uses Office.Interop

Karl Johan
  • 4,012
  • 1
  • 25
  • 36
3

Please go through the following URLs for redistribution:

How to make changes in references

Where to get distribution

This may help your suituation. And also according to the distribution page, you also need to install office also.

lakshmanaraj
  • 4,145
  • 23
  • 12
2

OpenXML?

I got it working at the moment to create Office 2007/Open Office spreadsheet files.

  1. Point to table
  2. Include column headers - optional parameter
  3. Detect data type - optional parameter
  4. Stream to user or save to file system or save to file system then immediately download.
  5. Outcomes an Excel file with cells that are detected as numbers / strings.
Joe Phillips
  • 49,743
  • 32
  • 103
  • 159
Dan B
  • 936
  • 2
  • 13
  • 26