I have a Wiki page which describes how to use an Excel spreadsheet, and includes a link. As the spreadsheet contains macros, I want it to always open in the desktop application, rather than Online.

Can I write JavaScript to emulate the Open in Excel option which appears on the menus in the document library to do this from my Wiki page?

Previously I had a link:


This tried to open in Excel Online, but warned the user it would only work in the desktop, so the simply clicked Launch Application and it opened in Excel desktop. At some point this has changed, and now the document opens in Excel Online.

Incidentally, most of our users are using Chrome.

Is there anyway I can write a script/force the link to open in the desktop app?

1 Answer 1


you don't need to write a script, you can just activate a site collection feature that opens the document in its client application:

  • Go to the Site Collection Settings Page
  • Activate the feature "Open Documents in Client Applications by Default"

Note: this will affect all type of documents not just Excel!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.