Learn TypeScript: Automate Excel Online with self-written add-ins

Microsoft Excel’s free online version contains many of the same functions and diagram tools as the desktop version. With Excel Online you can collaborate with others in real time in your browser, collect answers from online surveys and calculate numbers with functions. What is not so easy in the online version, however, is expanding and controlling the spreadsheet with Visual Basic for Applications (VBA). This requires Windows – as well as add-ins that were written with Visual Studio Tools for Office (VSTO) in VB.NET or C #.
The free version of Excel Online already masters many functions that are also known from the desktop edition, such as data preparation in diagrams.

(Image: Screenshot / Christian Imhorst)
Microsoft introduced the Excel JavaScript API as a solution in Office 2016. This means that users can not only automate tasks in the browser in the online version – the add-ins also work in the desktop version. With the API you can create and manipulate objects in Excel using TypeScript. We will show you step by step how to create such an add-in in Excel. The project requires basic programming knowledge in JavaScript to create dynamic websites. TypeScript is a superset of JavaScript and offers the convenience of a modern programming language. Many TypeScript constructs may be familiar to C # developers. No wonder: both languages ​​were promoted by one and the same chief developer: Hejlsberg is different. The TypeScript result is translated into JavaScript, which in turn runs in the browser. Any JavaScript code is also valid TypeScript code. Common JavaScript libraries such as jQuery can therefore also be used in TypeScript, as we will show using our small programming examples. In Excel you can develop add-ins with both languages, with the focus Many examples from the online community are mostly based on TypeScript.
  • Access to all heise + content
  • exclusive tests, advice & background: independent, critically well-founded
  • Read c’t, iX, Technology Review, Mac & i, Make, c’t photography directly in your browser
  • register once – read on all devices – can be canceled monthly
  • first month free, then 9.95 € per month
  • Weekly newsletter with personal reading recommendations from the editor-in-chief
Start FREE month Start your FREE month now Already subscribed to heise +? Sign up and read Register now and read articles right away More information about heise +
To home page



Leave a Reply

Related Posts