Click here to Skip to main content
16,011,996 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi
I have created web application that reads data from excel and store in a list. But now the thing is that client server doesnot have MS OFFICE 2010 installed on the server and they dont want to install MS OFFICE 2010. How can i read excel data from .xlsx file without MS OFFICE 2010 installed on the server?
Posted
Updated 31-May-16 1:17am
Comments
[no name] 26-Jun-13 12:01pm    
You use something other than Office such as OpenOffice.
learningcsharp2013 26-Jun-13 12:05pm    
I have MS OFFICE 2010 on my development machine but on client machine there is no MS OFFICE 2010 or OpenOffice.
[no name] 26-Jun-13 12:07pm    
And? Go download OpenOffice and use it!
[no name] 26-Jun-13 12:08pm    
You just said the you can't use Office to do this per your requirement so you have to go get something else that will do the same job.
learningcsharp2013 26-Jun-13 12:11pm    
So if i use open office ....Do I need to install it on client machine or not? Or is there a way to reference it to the project? I can use office but client don't want to install it on the server.

If the excel files are always going to be XLSX file then you could use an OpenXML componenet.
I recently used http://epplus.codeplex.com/[^] which I found to be very easy to use.

This is just a dll that you can package up with your website and use. On the site, although you need to read the licensing carefully.
 
Share this answer
 
just rename the *.xlsx file to a *.zip file and open it ;)
i guess this archive contains *.xml files.
 
Share this answer
 
Till Office 2003, Microsoft office documents where following the Binary format and you would need Office Interop to talk to Microsoft Office documents. But, this dramatically changed in Office 2007 forward. Microsoft follows the Open XML formats (of course, the XML tags are bit specific to Microsoft documents), but you can read all Excel, Word, Powerpoint files as plain XML documents like shown below:

XML
<?xml version="1.0"?>
<w:wordDocument xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml">
    <w:body>
        <w:p>
        </w:p>
    </w:body>
</w:wordDocument>



All you need to do is open these files using the Packaging interface which is part of .NET framework 2.0 and start reading the XML Parts using the Open XML standards.

Please refer to http://msdn.microsoft.com/en-us/library/bb456488.aspx[
Getting started with the Open XML SDK 2.5 for Office
] to have a jump start on this.
 
Share this answer
 
Of course you can!
Just download the introp library's here.
Download Visual Studio 2010 Tools for Office Runtime from Official Microsoft Download Center[^]
 
Share this answer
 
Comments
Patrice T 28-May-17 11:03am    
Just 4 years too late.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900