Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I programmatically create, read, write an excel without having office installed?

Tags:

c#

excel

I'm confused as hell with all the bazillion ways to read/write/create excel files. VSTO, OLEDB, etc, but they all seem to have the requirement that office must be installed.

Here is my situation: I need to develop an app which will take an excel file as input, do some calculations and create a new excel file which will basically be a modification of the first excel file. All with the constraint that the machine that runs this may not have office installed. (Don't ask why...)

I need to support all excel formats. The only saving grace is that the formats spreadsheets themselves are really simple. Just a bunch of columns and values, nothing fancy. And unfortunately no CSV as the end user might not even know what a CSV file is.

like image 391
eviljack Avatar asked Sep 02 '09 18:09

eviljack


People also ask

How can I read Excel file in C# without Microsoft Office?

Look for GSpread.NET. It's also an OpenSource project and it doesn't require Office installed. You can work with Google Spreadsheets by using API from Microsoft Excel. If you want to re-use the old code to get access to Google Spreadsheets, GSpread.NET is the best way.

Is there a program like Excel for free?

Essentially, Google Docs Spreadsheet is Google's own version of an Excel-like spreadsheet application; the only differences are that it's available for free, without having to download anything to your desktop.


1 Answers

write your excel in HTML table format:

<html> <body>   <table>     <tr>     <td style="background-color:#acc3ff">Cell1</td>     <td style="font-weight:bold">Cell2</td>     </tr>   </table> </body> </html> 

and give your file an xls extension. Excel will convert it automatically

like image 183
Gregoire Avatar answered Oct 14 '22 06:10

Gregoire