在 Mac OS X El Capitan 上使用 xlwings 打开 Excel 文件需要授予访问权限弹出窗口 [英] Using xlwings to open an Excel file on Mac OS X El Capitan requires Grant Access pop-up

查看:74
本文介绍了在 Mac OS X El Capitan 上使用 xlwings 打开 Excel 文件需要授予访问权限弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我手动授予对文件的访问权限,则我的代码能够在后续运行中打开该文档.我将每天处理新文件,因此我想消除授予访问权限弹出窗口.我试过 sudo python myscript.py,但它没有解决问题.

If I manually grant access to a file, my code is able to open the document in subsequent runs. I will be working with new files each day so I would like to eliminate the grant access pop up window. I've tried sudo python myscript.py, but it doesn't resolve the issue.

虽然 open() 函数能够打开文件,但我希望能够使用 xlwings 中可用的范围样式引用.

While the open() function is able to open the file, I want to be able to use the range style referencing available in xlwings.

您能否告诉我如何授予 Python(或仅我的脚本)权限,不仅授予当前文件夹中的单个文件,还授予将来添加到文件夹中的任何文件?

Will you please tell me how to grant Python (or just my script), not only to the individual files that are currently in the folder but also any files which get added to a folder in the future?

推荐答案

要为 Office 365 和 Catalina 恢复此线程:仍然需要在此处保存 Excel 文件:

To revive this thread for Office 365 and Catalina: it is still necessary to save Excel files here:

~/Library/Containers/com.microsoft.Excel/Data

避免提示授予​​访问权限.

to avoid the prompt for granting access.

或通常用于 Office 文件的此文件夹:

or to this folder generally for Office files:

~/Library/Group Containers/UBF8T346G9.Office

这篇关于在 Mac OS X El Capitan 上使用 xlwings 打开 Excel 文件需要授予访问权限弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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