Ty Anderson

Excel 2013 development – 7 questions developers should ask

Excel 2013 has plenty of new features. From Flash Fill to PowerPivot’s native engine, from Quick Analysis to the WebService() function there is plenty to excite the user base. But for Excel developer’s, the biggest news has to be the new Apps for Office extension framework.

Microsoft Excel has a long history of extension frameworks (e.g. VBA, XLLs, UDFs, VSTO, & COM). Each of these has their purpose and corresponding pros and cons. They work…and they work well. But Office (and Excel with it) is moving to the cloud. By “moving”, I really mean “embracing”.

Microsoft wants Office to work seamlessly on devices of all types (no word yet if that means multiple operating systems too). This means Office apps need to work on the desktop, on tiny devices, and on the web. By embracing cloud technologies, Office give developers a framework for building extensions that work “across the board”…on the desktop, on the tiny devices, and on the web.

This new extension framework appears like a no-brainer at first glance. You might even ask, “What took so long?”. If you do, I don’t blame you. But please note, that question is not part of today’s Q&A simply because I do not have an answer. Nonetheless, I’m glad to see this technology and look forward to building some solutions with it.

1. Will my current solutions work with Excel 2013?

Probably. Best I can tell, Microsoft has not changed or deprecated any of our beloved client solution frameworks (VBA, COM add-ins, XLLs, EDFs, and VSTO). That’s the good news. The “less than stellar” news is that Microsoft did not enhance the existing frameworks. Sure, they have been extended to support new objects like the ones listed on the RAD Excel blog but there are no new features to write about here. So let’s move quickly to question #2.

2. What are Excel 2013 content apps and what are task pane apps?

Both of these app types are part of the new Apps for Office solution framework. Essentially, they are web apps that run within Excel. You build them using HTML, CSS, and JavaScript and they load in a separate frame (think IFrame). The idea here is to allow us (Excel developers) to build apps that work with the rich web app version of Excel… from a single code base. I kinda like that idea. The apps are, perhaps, easier to build than the existing frameworks. Also, with the ability to publish these apps to Office App Store, finding customers for your apps might be easier as well.

Apps for Office

When you develop an app, the manifest file resides in the Office Store. When a user downloads your app, the manifest tells Office where your app resides. You can store your app on a web server of your choosing. After connecting to your app, Office displays within Excel. The illustration above shows an Excel 2013 Task Pane app.

Excel 2013 content apps

Content apps let you integrate web-based content within an Excel 2013 document. Once inserted, they look like any other Excel object. Big deal right? Simple right? Yes, the concept is simple but the power it offers is not to be ignored. When I first heard about this type of app, I thought about all the JavaScript libraries I could utilize for data visualizations.

Using Excel 2013 Content Apps, you can take advantage of web technologies in real time. There is no need to wait for a new version of Excel to build support for it. Don’t like the chart types provided by Excel out-of-the-box? Build a content app that utilizes Highcharts JS. Need access to functions not offered by Excel or simply need them to act differently? Write your own and use a content app to work with the data in your worksheet. This is a brilliant move by Microsoft.

Excel 2013 task pane apps

Task panes reside next to the document, not in it. They are analogous to traditional Office task panes and should be utilized in a similar manner. The idea with Excel 2013 Task Panes apps is to give you a method for providing contextual help to users as they build or work with an Excel document.

3. What Excel objects can I access with using these apps?

You can’t access the full COM object model. For that you need to continue to use, dare I say it… legacy solution frameworks like VBA, COM add-ins, and VSTO. What you can do is access a subset of the Excel object model using the Office.js JavaScript library. This library contains the objects, properties, & events that we are allowed to play with when playing in the Apps for Office playground. We have a new namespace for these objects: Microsoft.Office.WebExtension.

Object Name My Description
AsyncResult This object contains the result of a request. It will have the request status along with any errors.
Bindings (& Binding) Contains a binding to a document section. You don’t call it directly or it will bark at you. Instead, you use one of the three supported binding types: MatrixBinding, TableBinding, or TextBinding. I figure these objects are where the rubber hits the road and will be used often.
Context Context is everything. This object is the app’s runtime environment. It provides access to the JavaScript API.
Document This is the document attached to your app. You call it like this: Office.Context.Document.
Office Represents an instance of app, provides access to top-level API objects, and allows you to write a call-back function for the app’s Initialize event.
Settings Every add-in or app needs this object.

We don’t have access to the full object model. That stinks but I believe Microsoft is taking a solid step forward. Office is a COM-based system. The web isn’t and the web is kind of a big deal. Microsoft has to do something to integrate web technologies within Office. I’m hoping we don’t have to wait 3 years for Office.js to support more objects.

3. What other shiny new objects should garner my attention?

Questions #1 and #2 covered the big ones. The app store should be your major focus but other new features exist. I’m particularly interested in the DataModel objects that let you load and refresh data sources on the fly. Excel Services has new too. I think JavaScript UDFsare particularly exciting but you might find more interesting items in these articles:

4. Does Microsoft provide any guidance for how to design & build these apps?

As luck would have it, yes they do. The design guidelines are very helpful as are the best practices information. I think it will be easy to break these guidelines… there doesn’t appear to be any mechanism to enforce them. But breaking them is probably not in the best interests of the user (or you). I highly recommend Pieter’s write-up of the design guidelines. He does a great job interpreting them and providing an example app that implements them. His write-up is the second in the following list:

5. What tools do I need to get going and build some “Apps for Excel” using the apps for Office model?

You can build them using Visual Studio… You can build them using NAPA (part of Office 365 Developer)… Heck you can build them using a text editor if you really want to…

6. I’m having trouble getting my head around this concept, can you point me toward some useful, real-world type, demos?

Ummm… maybe. It depends on how you define the terms “useful” and “real-world”. What I can do is point you toward some interesting demos. Will that do? I think the first item in this list comes close to answering question #6 in the affirmative. It’s early. Office 2013 consumer preview has been running in the wild for just over a month. But give it time and we’ll have better demos. By we, I mean Add-in Express.

7. Will you stop typing now and give me the link love?

Absolutely. A lot more content exists than I can cover here. For deeper dive, follow these links… read the articles and keep on reading!

You may also be interested in:

6 Comments

  • Nicholas Hebb says:

    > new objects like the ones listed on the RAD Excel blog

    Finally, after all these years they added a Hwnd!

  • Dmitry Kostochko (Add-in Express Team) says:

    Hi Nicholas,

    Yes, they have added the Hwnd property to the Window object (though it is not documented yet). It is not a secret to anyone that Excel 2013 is a “multi-windowed” host application now. This property will help us to work with Excel 2013 windows and workbooks.

  • David Greenwood says:

    The images on this page are not displaying

  • Dmitry Kostochko (Add-in Express Team) says:

    Hi David,

    The images were linked directly from Microsoft’s web-site. And now, the images are not available any longer, so we have no way other than removing them altogether.

    Thank you very much for pointing this out for us.

  • Rak says:

    Hi,

    Need assistance. I’m trying to get last empty row in office 365 task pane app.
    But i dont see any api to do so.

    I’m currently adding data on a button click from task pane.
    What i see is on every next click data gets overwritten, or sometimes it throws error.

    The problem is that i have no api, where i can get my last empty row and then write from that particular row.

  • Ty Anderson says:

    Hi Rak,

    I understand your question completely as I did the same as you. I was convinced I should be able to traverse the spreadsheet in usual way with COM Add-ins and VBA. However, you can’t navigate freely with the new Apps for Office extensibility model. You can only navigate within the cells currently selected by the user.

    Ty

Post a comment

Have any questions? Ask us right now!