I am using xlwings to update large formulae in excel. I am not sure how to disable interacting mode with xlwings and doesn't look like I am impacted by this: pywin32 and excel. Exception when writing large quantities of data
我使用xlwings来更新excel中的大型公式。我不确定如何用xlwings禁用交互模式,而且看起来不像我受到的影响:pywin32和excel。写入大量数据时的异常
How can I debug the follow exception I am getting when I try to write a huge formula of the form ="ABC" + "DEF" + "XYZ" from a pandas dataframe to excel sheet? How to get to the root cause?
当我试图从熊猫dataframe写到excel表格="ABC" + "DEF" + "XYZ"时,如何调试我得到的这个异常?如何找到根本原因?
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2146827284), None)
pywintypes.com_error:(-2147352567’,异常发生。(0, None, None, None, 0,- 2146827284), None)
Thanks.
谢谢。
2 个解决方案
#1
1
You can get more information about the error like this:
你可以得到关于错误的更多信息如下:
>>> import win32api
>>> win32api.FormatMessage(-2146827284)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
pywintypes.error: (317, 'FormatMessageW', 'The system cannot find message text for message number 0x%1 in the message file for %2.')
After googling the error message it seems that it could be a 32 vs 64bit conflict.
在谷歌错误信息之后,看起来它可能是一个32位对64位的冲突。
I would try with a fresh installation as xlwings should work no matter what bitness combination you have between Excel/Windows and Python.
我将尝试一个新的安装,因为xlwings无论你在Excel/Windows和Python之间有多小的组合,xlwings都能正常工作。
#2
0
I eventually found a formatting issue with the formula being written. This issue is resolved for now but would be helpful for everyone if the error could provide details. 'Exception occurred' wasn't of much help. Thanks.
我最终发现了正在编写公式的格式问题。这个问题现在已经解决了,但是如果这个错误可以提供细节的话,对每个人都有帮助。“例外发生了”并没有多大帮助。谢谢。
#1
1
You can get more information about the error like this:
你可以得到关于错误的更多信息如下:
>>> import win32api
>>> win32api.FormatMessage(-2146827284)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
pywintypes.error: (317, 'FormatMessageW', 'The system cannot find message text for message number 0x%1 in the message file for %2.')
After googling the error message it seems that it could be a 32 vs 64bit conflict.
在谷歌错误信息之后,看起来它可能是一个32位对64位的冲突。
I would try with a fresh installation as xlwings should work no matter what bitness combination you have between Excel/Windows and Python.
我将尝试一个新的安装,因为xlwings无论你在Excel/Windows和Python之间有多小的组合,xlwings都能正常工作。
#2
0
I eventually found a formatting issue with the formula being written. This issue is resolved for now but would be helpful for everyone if the error could provide details. 'Exception occurred' wasn't of much help. Thanks.
我最终发现了正在编写公式的格式问题。这个问题现在已经解决了,但是如果这个错误可以提供细节的话,对每个人都有帮助。“例外发生了”并没有多大帮助。谢谢。