如何安排office.js加载项在特定时间在Sharepoint 2019上运行 [英] How to schedule office.js add-in to run at specific time on Sharepoint 2019

查看:93
本文介绍了如何安排office.js加载项在特定时间在Sharepoint 2019上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在每月的同一天无限期地运行excel-macro(在同一工作簿中复制和粘贴).该工作簿位于SharePoint 2019上,我没有任何外部计算机可以运行cron.

I need to run an excel-macro (copies and pastes w/in same workbook) on the same day each month indefinitely. The workbook resides on SharePoint 2019 and I do not have any external machines to run a cron.

据我了解,我可以使用office.js API或为其编写脚本,从而使我可以在基于SharePoints基于Web的excel GUI上运行宏.但是,我不了解/找不到有关如何自动/安排在特定时间运行宏的信息.

From my understanding I can use/script an office.js API that will allow me to run macros on SharePoints web-based excel GUI. However, I do not understand/can't find any information on how to automate/schedule the macro to run at a specific time.

我确实看到了这个在JavaScript中,如何在特定时间运行函数? 这,但是我不确定这是否会是最好的方法.

I did see this In JavaScript, how can I have a function run at a specific time? and this but I'm not sure that would work/would be the best method.

流量会很好,我看到有一个加载项 https://flow.microsoft.com/zh-cn/blog/introducing-microsoft-flow-integration-in-excel/,但看起来您无法做到"设定时间".我还可以想象可能存在长期问题,因为它的运行能力取决于用户权限.

Flow would be great, and I saw there is an add-in https://flow.microsoft.com/en-us/blog/introducing-microsoft-flow-integration-in-excel/ but it doesn't look like you can "set a time" for it to run. I would also imagine there could be long term issues in that its ability to run is based of user permissions.

如果您有更好的方法来实现我的期待,我也全神贯注.

In the case you have a better method of achieving what I am looking I'm all ears as well.

推荐答案

Office加载项只能在已打开的工作簿中工作,并且中没有任何办法.在指定的时间打开工作簿.如果您找到一种方法可以在指定的时间(在某人的计算机上)打开工作簿,则可以使用任务窗格加载项来检查日期并进行更改. (此代码应位于Office.initialize方法或Office.onReady方法中.请参见

An Office Add-in can only work in a workbook that is opened, and there isn't any way within an add-in to open a workbook at a specified time. If you can find a way to get the workbook to open at a specified time (on someone's computer), then you can have a task pane add-in that checks the date and makes the change. (This code should be in the Office.initialize method or the Office.onReady method. See Initializing your add-in.) You can then configure the add-in to autoopen whenever the workbook is opened. (See Automatically open a task pane with a document.)

这样做的缺点是,只要打开工作簿,任务窗格就会打开.这就是为什么代码应首先检查日期,然后检查是否已进行更改的原因.用户可能会对任务窗格感到困惑.无论如何,如果他们不希望在使用工作簿时看到它,则必须将其关闭.

A downside of this is that the task pane will open whenever the workbook is opened. That's why the code should first check the date and then check to see if the change has already been made. Users might be puzzled by the task pane. At any rate, they'd have to close it if they didn't want it visible while working with the workbook.

这篇关于如何安排office.js加载项在特定时间在Sharepoint 2019上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆