tags:

views:

381

answers:

6

I'm curious as to how many people are using Open XML (OOXML) these days (either pure or via the SDK) in closed and commercial environments. I'm fairly aware of what's going on on the 'public web' (MSDN, OpenXMLDeveloper.org, etc.), but am wondering about SO people's experience with it, both good and bad.

Are most people opting out of VBA and VSTO in favor of working directly with OOXML formats? What benefits are you getting from OOXML that you're not getting from the object model. I'd love to learn more about why you're using it or why you're not, what are you using it for, etc.

I'm just trying to get a feel from the community on OOXML as an approach toward document automation or other uses. I'm not finding community forums (this one or others) to be incredibly active with questions and users (check out the number of questions by tag of this post), so I'm wondering if I'm one of the very few who is using OOXML extensively.

+2  A: 

Now that Microsoft Office 2007 (and especially Excel) support Open XML, I'm finding it far easier to work with than Office Automation. A few major reasons for this are:

  • Better performance;
  • No flakey IPC issues (i.e. somebody left Excel open at the Save As dialog, crash);
  • No dependency on Office itself, or any external components whatsoever;
  • Fairly easy to write Linq extensions and queries against in C#;
  • Can be used in server environments without any problems or risks.

Given that Office XP/2003 users can open Office 2007 files with the Compatibility Pack, I don't see any reason to continue using the old automation or "OfficeML" methods. It's a bit of a learning curve, but it's arguably the best option today - it's free, it's reliable, and best of all it's the native format used by Office 2007 today and you don't need any stupid tricks to get it to work (like attaching the XLS content-type to HTML as we did for XL2003, and having XL2007 complain about an incorrect extension).

I wouldn't say it's an outright replacement for VBA/VSTO - the thing about those is that they're usually part of a solution where the requirement is to integrate with the Office environment itself. Using OOXML would generally require you to write an entire application around it. But for simple import/export, which is probably what 90% of automation has been used for in the past, definitely, OOXML is the way to go.

Aaronaught
Thanks Aaron, good insight.
Otaku
One concern with Open XML is if you still have a lot of users using Office 2003 and you are creating documents from scratch (i.e. not using Word or Excel). I've ran into some problems where I would create the file with the Open XML SDK and it would open fine in Office 2007, but when someone tried to open it in Office 2003 using the Compatibility Pack, it would crash. Just a FYI to test both versions of Office before releasing a document.
Adam Sheehan
@Adam: Interesting, I've never gotten a bug report about this, but I'll definitely be testing it from now on.
Aaronaught
+1  A: 

I have used Open Xml SDK for document generation in SharePoint, PPTX generation for custom presentations (pulling from XSLX for the data) and for "building" composite documents from multiple document segments.

The format and the SDK are great. No worries on the server in ASP.NET or SharePoint scenarios, and great speed. I have not found too many scenarios where the SDK or "brute force" xml cannot accomplish a goal. One instance is password protection and DRM for documents, but these are more corner cases. I would agree with aaronaught that this is not an exclusive solution, but SharePoint, VSTO and others are tools in the tool belt for document generation solutions.

Pete Skelly
That's interesting, the PPTX generation. Would that be a scenario, for example, like a sales person needs a custom deck for a particular customer and the backend uses the SDK to query on customer and data for insertion into a pre-built template?
Otaku
Okatu. I have done almost exactly that. Our customer are very happy with the result. I have also used Excel and Word to both import and export information from our system.
Andrew
Okatu, we have had situations with Word very similar to what you describe (pulling data from SharePoint and other external systems) to generate DOCX documents. The PPTX is very similar - creating custom slides based on data from an Excel file.
Pete Skelly
+1  A: 

I am doing the scenario that sales performance for a country is delivered in PPT Deck using Open XML

salgo60
interesting. Are you using the SDK or writing directly? Are you doing more complex BI reporting like charts and graphs?
Otaku
SDK 2.0 BetaBut feel it is a pain to use. I use the reflector the charts are creating using SoftwareFx chart package. The data is sells data where follow up how the company deliver on 40 different markets and we look into Values/Volumes/ Percentage / Market Penetration in different segments/ Growth / Share of Growth so yes it is BI but using Linq for SQL
salgo60
The usage is for deciding and motivating Discontinuation decisions on products on different markets
salgo60
+3  A: 

I looked at this technology a lot, I program in VBA, but it was way way to complex for my needs. There are some great things about using it that my elearning would benefit from, like Linq and XML, but the bar for going from VBA to the underlying formats is just too high and I don't have the luxury of the kind of time and money it would take investing in learning VS.Net and Open Office XML formats.

But the one thing I think it would really help with is meta-tagging PowerPoint content for an LMS.

Mahin
yeah, i suspected as much. making the change to .NET and other new technologies was a big leap from VBA.
Otaku
+2  A: 

Libraries like Simple OOXML can also greatly help with the learning curve.

James Westgate
That's a really good link. Thanks James.
Otaku
+1  A: 

I have done quite bit of professional work with XML / XSLT transformations to generate custom Excel interfaces for a planning application. Most of the work was more proof of concept than aactual development but it looks like there is great potential. I have predominantly done most of the work using c#.

One question I have though: Is it possible to create binary content using XSLT? I need to have some macros to run the application but still forced to add these manually after doing the XSL transformations.

Thanks.

Peter