Skip to content

Instantly share code, notes, and snippets.

@ShellyShulei
ShellyShulei / StockOnline (1).EXCEL.yaml
Created December 13, 2019 15:07
Calls the GitHub API to get the star count for an org/user and repository.
name: StockOnline (1)
description: Calls the GitHub API to get the star count for an org/user and repository.
host: EXCEL
api_set: {}
script:
content: |
/**
* Gets the stock price online. Try =getStockOnline("FB")
* @customfunction
* @param symbol
@ShellyShulei
ShellyShulei / StockOnline (1).EXCEL.yaml
Last active December 13, 2019 15:03
Calls the GitHub API to get the star count for an org/user and repository.
name: StockOnline (1)
description: Calls the GitHub API to get the star count for an org/user and repository.
host: EXCEL
api_set: {}
script:
content: |
async function getStockOnline(symbol) {
var API_KEY = "8KOBOUBTEF7RHR21";
const requestURL = `https://www.alphavantage.co/query?function=TIME_SERIES_MONTHLY&symbol=${symbol}&apikey=${API_KEY}`;
@ShellyShulei
ShellyShulei / Stock.EXCEL.yaml
Last active December 12, 2019 05:03
Calls the GitHub API to get the star count for an org/user and repository.
name: Stock
description: Calls the GitHub API to get the star count for an org/user and repository.
host: EXCEL
api_set: {}
script:
content: |
/**
* Gets the star count for a given org/user and repo. Try =GETSTARCOUNT("officedev","office-js")
* @customfunction
* @param userName Name of org or user.
@ShellyShulei
ShellyShulei / Function.EXCEL.yaml
Created December 11, 2019 16:04
Calculates the volume of a sphere.
name: Function
description: Calculates the volume of a sphere.
host: EXCEL
api_set: {}
script:
content: |
/**
* Calculates the volume of a sphere.
* @customfunction
* @param {number} radius
@ShellyShulei
ShellyShulei / URL.EXCEL.yaml
Last active December 10, 2019 18:49
Create a new snippet from a blank template.
name: URL
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
script:
content: >
$("#submitStockData").click(() => tryCatch(getStockData));
$("#COPY").click(() => tryCatch(writeAPIDataToExcel("2019-12-10
13:30:00")));
@ShellyShulei
ShellyShulei / Working With Tables.EXCEL.yaml
Created December 10, 2019 15:20
Create and manipulate a table with the JavaScript API.
name: Working With Tables
description: Create and manipulate a table with the JavaScript API.
host: EXCEL
api_set: {}
script:
content: |
$("#createtable").click(() => tryCatch(CreateTable));
$("#adddata").click(() => tryCatch(AddData));
$("#filter").click(() => tryCatch(Filters));
$("#clearfilter").click(() => tryCatch(ClearFilters));
@ShellyShulei
ShellyShulei / search insert value.EXCEL.yaml
Created December 9, 2019 18:32
Orders the plotting of series in a chart.
name: search insert value
description: Orders the plotting of series in a chart.
host: EXCEL
api_set: {}
script:
content: |
$("#setup").click(() => tryCatch(setup));
$("#order-series-plot").click(() => tryCatch(addSeries));
$("#findCompleted").click(() => tryCatch(findCompleted));
@ShellyShulei
ShellyShulei / Import JSON data.EXCEL.yaml
Created December 9, 2019 15:34
Import JSON data into a table
name: Import JSON data
description: Import JSON data into a table
host: EXCEL
api_set: {}
script:
content: |
$("#import-json-data").click(importJsonData);
async function importJsonData() {
try {
@ShellyShulei
ShellyShulei / Demo1.EXCEL.yaml
Created December 9, 2019 06:38
created on 12.09
name: Demo1
description: created on 12.09
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(playwithWorkbook));
async function playwithWorkbook() {
await Excel.run(async (context) => {
@ShellyShulei
ShellyShulei / Basic API call (JavaScript).EXCEL.yaml
Created December 6, 2019 14:57
Performs a basic Excel API call using plain JavaScript & Promises.
name: Basic API call (JavaScript)
description: Performs a basic Excel API call using plain JavaScript & Promises.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
function run() {
return Excel.run(function(context) {