Is there any ways to set "Open in Teams" as default when user click an excel link?

Copper Contributor

Now I am studying how to building a bot in Teams. 

I can choose different ways to open it when using Teams.  By clicking "Open in Teams" or open it in a pop-up browser.
However, I don't see any information in the official documents about how to enable it when developing Teams Bot. For example, a bot provide an excel file/link to users, users open it and edit it in Teams  instead of opening it in O365  of pop-up window

Does anyone know how to do it?


1 Reply

@Jimmy1116 Yes, there is a way to open excel file inside Teams. You need to modify the URL of the excel link into below format.

Ex: if your file URL is "https://my-url/someexcelfile/"

Step 1: Replare "/" with "~2F" in the ULR 

update URL should look like : "https:~2F~2Fmy-url~2Fsomeexcelfile~2F"

Step 2: Create team viewer URL with below format.<File-Type>/viewer/teams/<updated-URL>

Final URL should look like


This URL works for other file format as well. For viewing PDF file, you can replace "xlsx" with "pdf" and update the URL for pdf file.


Hope it helps.