• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 558
  • Last Modified:

Create an XLSX from C#

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
davism
Asked:
davism
  • 8
  • 5
1 Solution
 
davismAuthor Commented:
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
 
BuggyCoderCommented:
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
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
davismAuthor Commented:
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
 
BuggyCoderCommented:
then com is the option i suppose....
0
 
davismAuthor Commented:
By the way, this is all using VS 2008 with .NET 3.5 (which that requires .NET 2.0)
0
 
davismAuthor Commented:
But isn't COM for XLS? And not for XLSX? (obviously 2 different flavors MS).
0
 
BuggyCoderCommented:
i think the url that i gave in my first post should solve the problem....
0
 
davismAuthor Commented:
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
 
davismAuthor Commented:
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
 
davismAuthor Commented:
And the NPIO 1.2.1 for .NET 2.0
0
 
davismAuthor Commented:
Thanks for the response and information. Turns out that using the XML's was really the only way. :-(

Thanks though and much appreciated.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 8
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now