-1

I was wondering, if I don't have excel office product not installed on my server, how can I write to an excel document using .net code? I know there's a Microsoft.Inerop.Excel assembly that will assits in this, but it doesn't work for me. I get a CLSID id error where is looking for this particualr guid, but its not installed on my machine. I have the Interop assemblies installed on my server, but I can't use the Excell.Application object. Is there another object that i can use instaed of Excel.Application() to create an excel document on a server where the offce excel product is not installed on? Also my box is 64 bit running SharePoint, if you have any alteratives using SharePoint 2010 I would like to hear about them as well.

Thank You,

Brandon Michael Hunter
  • 1,179
  • 3
  • 20
  • 48
  • 3
    Forget about programming. Because programming is logic. And if you don't have something not installed, it means it is installed. – iDevlop Dec 05 '10 at 21:12
  • What do you mean by "if you don't have something not installed, it means iti is installed"? So are you saying that since the excel product is not installed, I can't create an excel file using the Microsoft.Interop.Excel? – Brandon Michael Hunter Dec 05 '10 at 23:13
  • Not particularly helpful answer from iDevelop but he's correct. Microsoft.Interop.Excel is an interface for working with Excel - but it will not work if Excel is not present on your server. In any case - its a really BAD idea to use Excel programatically on a server, its not designed for that - its designed for a user sitting in front of it. What are you going to do when Excel pops up a message box asking for some confirmation - there is no one sat there to click it. Look at 3rd party in by Olaf linked articles. – Ryan Dec 06 '10 at 08:46
  • possible duplicate of [Create Excel (.XLS and .XLSX) file from C#](http://stackoverflow.com/questions/151005/create-excel-xls-and-xlsx-file-from-c) – bzlm Dec 07 '10 at 08:28
  • lol, please edit the question! use Office XML SDK, or a 3rd party library. – Anonymous Type Aug 19 '13 at 06:48

1 Answers1

1

There are several Third Party tools, commercial ones like Spire.xls (which we have used, and it works quite well) and freeware, like excellibrary (http://code.google.com/p/excellibrary/).

This has been asked before, see Create Excel (.XLS and .XLSX) file from C# (guess someone may close that question).

Community
  • 1
  • 1
Olaf
  • 10,049
  • 8
  • 38
  • 54