I\'m writing an Office Add-in (formerly, Apps for Office). I\'m using office.js and in some point of code I want to check if the app is running in excel (deskto
office.js
Inspired by Sturb's answer, the following works with ExcelApi 1.10 & 1.12
if (window.top.window == window) { // Add-in is running in Excel desktop } else { // Add-in is running in Excel online }