V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  Hyanide  ›  全部回复第 1 页 / 共 1 页
回复总数  7
@Latin 而且也用了 os.path.abspath(rel_path),这个路径
@Latin 大神,按照链接中帖子,添加了下方语句,还是失败

添加了帖子中的方法:
import win32api
win32api.FormatMessage(-2147352565)
'Invalid index.\r\n'
补充一下错误反馈:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Program Files\JetBrains\PyCharm 2020.1.1\plugins\python\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "C:\Program Files\JetBrains\PyCharm 2020.1.1\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/hyani/Documents/Masterpiece/demo/zh.py", line 21, in <module>
sht.range(A[i]).formula = '='+C[i]+'/1.01'
File "C:\Users\hyani\AppData\Local\Programs\Python\Python38\venv\lib\site-packages\xlwings\main.py", line 842, in range
return Range(impl=self.impl.range(cell1, cell2))
File "C:\Users\hyani\AppData\Local\Programs\Python\Python38\venv\lib\site-packages\xlwings\_xlwindows.py", line 610, in range
xl1 = self.xl.Range(arg1)
File "C:\Users\hyani\AppData\Local\Programs\Python\Python38\venv\lib\site-packages\xlwings\_xlwindows.py", line 66, in __call__
v = self.__method(*args, **kwargs)
File "<COMObject <unknown>>", line 2, in Range
pywintypes.com_error: (-2147023170, '远程过程调用失败。', None, None)
@TrickWu 感谢楼上三位
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   4537 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 14ms · UTC 10:08 · PVG 18:08 · LAX 02:08 · JFK 05:08
Developed with CodeLauncher
♥ Do have faith in what you're doing.