Skip to content

Instantly share code, notes, and snippets.

@ci010
Created August 25, 2021 09:17
Show Gist options
  • Save ci010/5aacf0ff3ca85361d600ea605040ffd0 to your computer and use it in GitHub Desktop.
Save ci010/5aacf0ff3ca85361d600ea605040ffd0 to your computer and use it in GitHub Desktop.
Possible Mismatch in Top parameter of range when zoom level of sheets are deferent.
name: Range Top Mismatch
description: >-
Possible Mismatch in Top parameter of range when zoom level of sheets are
deferent.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
const r = context.workbook.getActiveCell();
r.numberFormatLocal = "$#,##0.00_);[Red]($#,##0.00)a---a923'];]1/-*";
await context.sync();
console.log("good");
});
}
/** Default helper for invoking an action and handling errors. */
async function tryCatch(callback) {
try {
await callback();
} catch (error) {
// Note: In a production add-in, you'd want to notify the user through your add-in's UI.
console.error(error);
}
}
language: typescript
template:
content: "\n<section class=\"setup ms-font-m\">\n\t<h3>Trigger numberFormatLocal Error</h3>\n\t<button id=\"run\" class=\"ms-Button\">\n <span class=\"ms-Button-label\">Run</span>\n </button>\n</section>\n"
language: html
style:
content: |-
section.samples {
margin-top: 20px;
}
section.samples .ms-Button, section.setup .ms-Button {
display: block;
margin-bottom: 5px;
margin-left: 20px;
min-width: 80px;
}
language: css
libraries: |
https://appsforoffice.officeapps.live.com/afo/lib/beta/hosted/office.js
https://appsforoffice.officeapps.live.com/afo/lib/beta/hosted/office.d.ts
office-ui-fabric-js@1.4.0/dist/css/fabric.min.css
office-ui-fabric-js@1.4.0/dist/css/fabric.components.min.css
core-js@2.4.1/client/core.min.js
@types/core-js
jquery@3.1.1
@types/jquery@3.3.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment