Solved

Create an XLSX from C#

Posted on 2012-04-07
13
525 Views
Last Modified: 2012-06-22
Hi all,

I have looked in several places but many show show to create an .xls file but I'm looking on creating a .xlsx file (Microsoft Office Excel 2007).

I cannot use the OpenXML open source. It has to be Microsoft Office.

I didn't think the COM Interop would need to be used for .xlsx.

If that is the case how would it be done?

Any information and an example would be greatly appreciated.

Thanks
0
Comment
Question by:davism
  • 8
  • 5
13 Comments
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37819667
0
 
LVL 1

Author Comment

by:davism
ID: 37820215
Hmmm...interesting. Is there another way using a COM or .NET reference for Excel that has these pieces and parts for the XML's or is it all XML based? Meaning there would be no COM or .NET object to use?
0
 
LVL 20

Accepted Solution

by:
BuggyCoder earned 150 total points
ID: 37820221
see this if you want to export data to excel file, here are 9 different ways to do it:-

http://www.codeproject.com/Articles/164582/8-Solutions-to-Export-Data-to-Excel-for-ASP-NET
0
 
LVL 1

Author Comment

by:davism
ID: 37820227
No, I don't want to export data. I want to create a file and add rows and columns to the file.

That's all. Right now, I have it in a comma delimited file but I want to see about making it more integrated and creating new sheets in the spreadsheet xlsx.
0
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37820230
then com is the option i suppose....
0
 
LVL 1

Author Comment

by:davism
ID: 37820233
By the way, this is all using VS 2008 with .NET 3.5 (which that requires .NET 2.0)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:davism
ID: 37820235
But isn't COM for XLS? And not for XLSX? (obviously 2 different flavors MS).
0
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37820238
i think the url that i gave in my first post should solve the problem....
0
 
LVL 1

Author Comment

by:davism
ID: 37820251
Except that requires open source and I can't do that. The "using ICSharpCode.SharpZipLib.Zip;"

If I pursued that I would have to see about using it with like Winzip or the Windows Compression instead. Probably Winzip though because the Windows Compression is somewhat problematic.
0
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37820255
0
 
LVL 1

Author Comment

by:davism
ID: 37820262
Yeah, I saw that one previously as well. I wasn't too sure though. Because the nature of the ExcelPackage.

I have to look at that in a little more detail.
0
 
LVL 1

Author Comment

by:davism
ID: 37820264
And the NPIO 1.2.1 for .NET 2.0
0
 
LVL 1

Author Closing Comment

by:davism
ID: 37972632
Thanks for the response and information. Turns out that using the XML's was really the only way. :-(

Thanks though and much appreciated.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now