Comments (10)
Hi @ishanig11 Thanks for reporting this issue. I run this code and context workbook is getting closed. Could you please try again? Thanks.
async function run() {
await Excel.run(async (context) => {
context.workbook.close(Excel.CloseBehavior.skipSave);
await context.sync();
});
}
from office-js.
@shanshanzheng-dev : I am using similar code but for me no error no message. Also my action button is present under task pane.
Is it possible for you to share this sample application? And also video of behavior?
from office-js.
Hi @ishanig11, I use script lab to run this code, you can check this video:
Screen.Recording.2024-06-17.at.07.41.08.mov
from office-js.
I used same code from function getting called in executeFunction. But not working.
from office-js.
Hi @ishanig11 This is my Excel online build number: 16.0.17809.42308. And this is my test code on script lab:
$("#run").on("click", () => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
context.workbook.close(Excel.CloseBehavior.skipSave)
await context.sync();
});
}
/** 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);
}
}
from office-js.
Thank you @shanshanzheng-dev . It worked. But is there anyway to avoid that popup?
from office-js.
do you meaning this below picture? I think this is by design and we can't avoid it.
from office-js.
Yes, this dialog.
from office-js.
Hi @ishanig11, I'm afraid that we can't avoid this dialog, this is by design. Thanks.
from office-js.
Related Issues (20)
- How to use workbox in Excel Addin HOT 3
- Access custom spam reporting features in other menus HOT 1
- In a custom Spam reporting add-in, microsoft defender is not triggered HOT 1
- Custom function "error installing functions" via Admin Managed. Working on Local and Sideload HOT 21
- Get username of current user HOT 3
- Spam addin event.options is an array in classic outlook and is an object/structure in browsers/new look outlook. HOT 1
- Outlook 365 add-in not loading on MAC/OS new Outlook app. HOT 8
- Powerpoint Add-in is not updating automatically without any notification HOT 5
- Custom function handling of Entity Value is broken again HOT 6
- Office.context.roamingSettings.get() size limit HOT 2
- Word close API not working HOT 3
- Powperpoint close API HOT 6
- Manifest file sideloads on Excel web but does not sideload on Mac or Windows os HOT 2
- Opening dialog in iframe for an Excel custom function handler fails on alternate invocations HOT 6
- Outlook Add-in - Call to mailbox.getUserIdentityTokenAsync returning undefined token for only some Outlook accounts HOT 12
- Assistance Needed with Outlook Add-In installing Manifest for older version of Outlook HOT 4
- MIME parts returned by getAsFileAsync() don't include Content-Disposition on Outlook Win32
- Permission under manifest file HOT 5
- Content copy pasted as table not being considered as body text using getAsync(Office.CoercionType.Text) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from office-js.