Skip to content

Instantly share code, notes, and snippets.

@GeorgeHung
GeorgeHung / NumberFormat.EXCEL.yaml
Last active January 15, 2021 04:02
Formats a range.
name: NumberFormat
description: Formats a range.
host: EXCEL
api_set: {}
script:
content: |
$("#setup").click(() => tryCatch(setup));
$("#set-number-format").click(() => tryCatch(setNumberFormat));
@GeorgeHung
GeorgeHung / Fix Template.EXCEL.yaml
Created October 13, 2020 17:53
Create a new snippet from a blank template.
name: Fix Template
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
const svTag = "SmartViewData";
const svUTF16Tag = "SVUTF16";
@GeorgeHung
GeorgeHung / Blank snippet (2).EXCEL.yaml
Created October 12, 2020 19:45
Create a new snippet from a blank template.
name: Blank snippet (2)
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
const svTag = "SmartViewData";
const svUTF16Tag = "SVUTF16";
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(fixUDFLink));
function fixUDFLink(callback) {
Excel.run(function (ctx) {
@GeorgeHung
GeorgeHung / Blank snippet.EXCEL.yaml
Created June 9, 2020 01:37
Create a new snippet from a blank template.
name: Blank snippet
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
//Save and write into file
@GeorgeHung
GeorgeHung / Blank snippet.EXCEL.yaml
Created April 21, 2020 22:39
Create a new snippet from a blank template.
name: Blank snippet
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
@GeorgeHung
GeorgeHung / Basic API call (JavaScript).EXCEL.yaml
Created February 4, 2020 02:14
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) {
@GeorgeHung
GeorgeHung / Parese Date Value.EXCEL.yaml
Last active January 13, 2020 06:20
Parse the date value from Excel with Javascript
name: Parese Date Value
description: Parse the date value from Excel with Javascript
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
function SerialDateToJSDate(serialDate, offsetUTC) {
return new Date(Date.UTC(0, 0, serialDate, offsetUTC));
@GeorgeHung
GeorgeHung / Save Settings in Data Change.EXCEL.yaml
Last active September 26, 2019 23:47
Create a new snippet from a blank template.
name: Save Settings in Data Change
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function onChange(event) {
await Excel.run(async (context) => {
name: Test Dialog API
description: ''
host: EXCEL
api_set: {}
script:
content: >
$("#run").click(() => tryCatch(run));
function processMessage(arg) {