Office 12 XML Formats will support VBA (just not the default formats)

There are two forms of the new formats, one that supports VBA and one that doesn’t. I just read this article, and it sounds like there have been some misunderstandings around this fact. If you read through the whitepapers (Microsoft Office Open XML Formats) (Developer View of Office Open XML Formats), you’ll see that there are two new forms of the XML file formats. The default formats (.docx, .pptx, .xlsx) will not support VBA. There will also be “macro-enabled” versions of the new formats that will have different extensions (.docm, .pptm, .xlsm) and different content types of the parts within the files.

We created these two new types so that it would be easier to identify and deal with files that have code in them. We are by no means moving away from VBA though, which is why we have the macro-enabled versions of the new formats. VBA is still very important for a ton of our customers, and we will continue to support their solutions going forward using the new file formats. So, if you want to store VBA in your documents, you can either use the current binary formats (.doc, .xls, .ppt), or you can use the macro-enabled version of the new formats (.docm, .xlsm, .pptm). Anyone can change what format is used as the default as well, so if you decide you want to default to the macro-enabled version you can easily do this (it can be centrally controlled via policy as well)

I’ll make a future post that goes into the technical details of what’s different between the two formats.


Comments (11)

  1. Hi Brian

    Can I have a default of ".xlsx if there is no code and .xlsm if there is some"?

  2. W Poust says:

    Will there be a way of signing the macros and locking the macros so they can’t be tampered with?

  3. BrianJones says:

    Stephen – if you try to save a file in the .xlsx format and there are macros you will be prompted if you want to use .xlsm instead, which is pretty much the behavior you are asking for.

    W Poust – The locking and signing of macros will be done in the same way that it is today in the binary formats.


  4. Ricky Dhatt says:

    .xls, .xlsx, .xlsm

    Aren’t you worried about customer confustion by having 3 main formats?

  5. Luc Kordel says:

    Hi Brian,

    How will the office 12 XML formats impact the metadata in Office documents. Now, as an IT forensic audutor, we have two ways to proceed: 1)we use dedicated software to visualize metadata items in e.g Word of Excel files.

    2) we use an hex editor and the Open Source definitions of the Word of Excel file layout and start looking for the right record type and the right offset within that record.

    Will there be special tags for metadata?


  6. BrianJones says:

    Ricky, we are definitely concerned about end user confusion from the move to new file formats. We are going to great lengths to make it so that the average end user doesn’t need to every think about what format they are in. There will be times when they are faced with making a decision in formats, and we plan to make that as clear and simple a decision as possible. We are going to look closely though usability studies and the Beta programs to see what the impact of this change is on the end user and see how we can make the impact as small as possible.

    Luc, the metadata will be easily identifiable and accessible. It will be in its own XML part within the ZIP package that you can quickly find by accessing the root relationship of the package. The schema for the metadata is pretty simple so the XML files shouldn’t be too difficult to work with. I think these new formats create a whole new world of document interrogation and make possible some very rich solutions that leverage the contents of the documents.


  7. Most users don’t know what a macro is, let alone whether their document contains macros, or whether it should contain macros. While it’s true that many of these users will never see the file extensions, way too many will. It’s counter-productive to ask users questions they don’t need to answer.

    The processing of the file should be based on its contents, not its name. The operating system can’t handle macro-enabled spreadsheets differently from data-only spreadsheets, since virus writers will just save the file as .xlsm, then rename it to .xlsx.

    If the only difference between two XML formats is that one can contain macros and the other doesn’t, then wouldn’t it be better just to use a separate namespace for the macro elements? That way you could guarantee there are no macros by using a validating parser, or strip them out by ignoring elements in the macro namespace.

  8. Mike Staunton says:

    I make extensive use of VBA by writing my own user-defined functions for derivative pricing – these UDFs seem to be little known and in the current debate on file formats tarred with the "macros are bad, poor security brush" – though i’m not sure how true this is for module sheets with only code for functions

    These are very popular because nearly all students and people that work in investment banks use Excel – but most don’t necessarily want to move up to Visual Studio as a front end – though some might wish to use the automation add-in facility in Excel to call functions written in C# for instance

    VSTO is irrelevant for me – i’m much happier writing proper program code that can be called from Excel – i’m not interested in using a more complicated VSTO language and front end to replicate what I can already do in a spreadsheet

    One thing that I am trying to do though is write my VBA code in such a fashion that it can easily be translated into C# (via the Instant CSharp program)

  9. Chris says:

    The macro disabled file formats is bad news for end users in the corporate world. Have no doubt, the high priests of technology in the corporate world will use the tool that Microsoft will be providing to reassert their control and prevent work from getting done.

    No doubt Microsoft thinks it can’t be held responsible for corporate stupidity. But Microsoft can be held responsible for who it trusts. As I look at a corporate notebook with wireless built in but with an XP configuration so that wireless can never be used, I think Microsoft decided to trust the wrong folks.

    This macroless file format is also very bad news for Microsoft because it seals the replacement of Microsoft Office with open source packages. Corporations will use Microsoft’s file format to eliminate macros. Once macros are gone, the barriers to replacing Office with something else are greatly reduced. With the barrier down, corporations will look at the open source products. Since Microsoft has not been able to compete on price, it will lose that battle.

    Given its recent actions, Microsoft cannot count on end users to fervently oppose replacing Office with an open source packages. (1) Most users use very few features so they don’t really care. (2) The users who do care push the packages. In ancient times, Microsoft supported those users by adding features that empowered them to get their jobs done without going through the high priests of technology. In the 21st century, Microsoft has not supported those users. Instead Microsoft has focused on adding features that empower the high priests of technology to prevent all end users (including the power users) from doing work. In addition to not supporting power users, Microsoft’s list price for VSTO is $500! Microsoft’s wrong priorities and what feels like price gouging will severly dampen the loyalty and enthusiasm of power users, who are Microsoft’s best (and perhaps only) allies against swapping out Office.

  10. In the last post, I showed you how to use the Packaging API to find a particular part and get that part’s…

  11. Kris says:

    Hi Brian

    On the other day i tried to open up a simple .xml document in word 12 and tried to create a macro such that i would disable some menu items. The VBA environment that comes with it doesn’t give handles to the "The Ribbon" talked so much about!!! How would i run my previous macros (developed for earlier versions) with Office 12 ????