Search code examples
exceloffice-jsscriptlab

Cannot create snippet and view samples in script-lab in MS-Excel Office365


Problem: Below are the images to understand the behavior of Script-Lab on my machine. It happens across all office products that I tested For e.g. Excel, Word or PowerPoint. So, I can't create new snippet and can not see the samples.

Environment: I am using registered Microsoft Office 365 ProPlus version 1708 (Build 8431.2215) on Windows 10 Operating system (desktop) and default browser is Internet Explorer (11.1029.15063.0). The installation appeared successful. I didn't faced any error during installation. The Script Lab menu is appearing just fine but not working eventually.

More info: Interestingly, I can view, edit and run the snippets saved on GitHub gist but I can't create my own or view samples due to this error (see screenshot below)

Screenshots: #1: When I create a new snippet, it says that it can't import the snippet. Error: When creating a new snippet using the + button in Script-Lab Code Window

#2: When I click on samples to view existing samples, it says that there aren't any samples available for this host yet. Error: Unable to see the samples.


Solution

  • Below are the proven valid scenarios for the Script-Lab to behave in undesired manner as happened in my case above. I am adding the solution, if anyone encounter it again, please follow the steps below.

    Identify the problem : In the background, when script-lab opens it tries to access github content. So, if you

    1. do not have internet connection, or
    2. have firewall protecting github url (specifically, raw.githubusercontent.com)

    then neither Snippets nor Samples will be loaded in the script-lab. So, make sure you can open the links below

    https://raw.githubusercontent.com/OfficeDev/office-js-snippets/deploy-prod/playlists/excel.yaml

    https://raw.githubusercontent.com/OfficeDev/office-js-snippets/deploy-prod/samples/excel/01-basics/basic-api-call.yaml

    In my case, organization is blocking the urls containing raw as I could otherwise access every other link on github.


    Solution: If for any reason, you can't still access these URLs, then as a workaround, you can access all the samples from https://github.com/OfficeDev/office-js-snippets/tree/master/samples/excel and then choose one and copy-paste the entire YAML. Eg.., for the default sample, just paste in the following into the "import" textbox or you can use import facility to use the YAML links at this location.


    Feedback : If you happen to be a script-lab developer, I believe these samples can be the part of Excel add-in, proving more useful for offline users of various organisations.

    Source: Resolved on Github.