views:

257

answers:

1

Does anyone have any good answer what kind of difference there is between

  • using some arbitrary pre-formatted Excel 2007 *.xlsx file as a template, loading it in my C# app, and filling up some of its cells with data using the Microsoft OpenXML SDK

versus

  • creating specific Excel templates (*.xltx) files and using those as basis for my "data filling" exercise

Do I loose something when I don't use the Excel templates (*.xltx)?

If so - what do I loose?

+3  A: 

No, you don't lose anything at all. An XSTX is the same as an XLSX in all respects - it's just that Excel creates a new instance of an XLXS if the file opened is an XSTX. That's all. If you use an XSTX for your data filling and save out an XSLX, every new instance (XLSX) will have that data when the resulting XSLX is opened.

The other question is whether or not you need to use an XSTX at all if you are doing your data-filling from OOXML - I don't see any reason why you would need to use an XSTX at all as long as your pre-formatted XSLX is saved with a different file name, your XSLX should be fine as a template. An XSTX is really meant for Excel client app operation - programmatic solutions such as OOXML offer no benefits in using a different file extension (not true of VSTO however, which is also an Excel client app operation).

Otaku
Great reply - thanks for your insights!
marc_s