ypeError:int()参数必须是字符串,类字节对象或数字,而不是' NoneType'

时间:2016-03-18 09:22:35

标签: xlwings

如果尝试做示例我有错误 http://docs.xlwings.org/en/stable/vba.html

 ---------------------------
Error
---------------------------
Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "C:\Python3\mymodule.py", line 7, in rand_numbers

    n = int(Range('Sheet1', 'B1').value)  # Write desired dimensions into Cell B1

TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'



Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK   
---------------------------

1 个答案:

答案 0 :(得分:0)

我建议由于单元格中的缺失值而发生错误。在转换为int之前,请尝试检查值是否为{{1}}。