xlwings book打开excel工作簿但将文件名更改为小写
我使用 xlwings 打开 Excel 工作簿。到上个月为止都运行良好。但是今天,当我运行相同的代码时,它打开了我的工作表,但将我的工作表名称转换为小写。
有人知道这是为什么吗?我怎样才能保留原来的大写字母?
我使用的是 Windows 10。
例如,当我运行下面的代码时,ABC.xlsx 自动由 xlwings 转换为 abc.xlsx。
import xlwings as xw
fullPath = ''\\\\xxx\\xxx\\ABC.xlsx'
psw = '123'
wb = xw.Book(fullPath, password = psw)
I used xlwings to open excel workbook. It worked fine up to last month. But today, when I run the same code, it opened my worksheet but convert my worksheet name into lowercase.
Anybody know why is that? And how can I keep my original captalization?
I am using windows 10.
Example, when I run below code, the ABC.xlsx automatically converted abc.xlsx by xlwings.
import xlwings as xw
fullPath = ''\\\\xxx\\xxx\\ABC.xlsx'
psw = '123'
wb = xw.Book(fullPath, password = psw)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了同样的问题,我不确定为什么会这样做(我认为它只发生在受保护的工作簿上)。一个简单的修复方法是再次重命名该文件,如下所示:
此代码假定您的路径和文件保存在 fullPath 下。
I had the same issue and I am not sure why it does that (I think it only happens to protected workbooks). An easy fix is renaming the file again as follows:
This code assumes that your path and file are saved under fullPath.