timxx / pywpsrpc

Python bindings for WPS Office RPC (for Linux)
MIT License
219 stars 44 forks source link

AttributeError: Call get_Value() failed with 0x80010010 #58

Closed 12893822294 closed 1 year ago

12893822294 commented 1 year ago

报错信息 AttributeError: Call get_Value() failed with 0x80010010 似乎是在使用方法出错的时候会出现,比如在调用Worksheet.Range(2) 之后,就一直出现这个错误,不只是get_Value()这一个错误 所有接口都会报错,并且这个Excel就调用不了了 只能删掉,重新建一个

12893822294 commented 1 year ago

Worksheet.Range() 但里面传入一个区域的时候,经常会出现这种情况, 比如: Worksheet.Range("A1:B2").Value 只有在传入单元格的时候才能没问题 Worksheet.Range("A1").Value

timxx commented 1 year ago

可以给一个完整一点的调用例子么?

12893822294 commented 1 year ago

下面是一个例子: _hrs, rpc = createEtRpcInstance() _hrs, app = rpc.getEtApplication() app.Visible = False book = app.Workbooks.Open(file) sheet = book.Worksheets['Sheet1'] result = sheet.Range('A1:B2').Value

但实际可能要对Excel文件进行一些操作,就会导致这段代码失败 比如先往里面写一个二维列表 sheet.Range('A1:B2').Value = [['a', 'b'], ['c', 'd']] book.Save() 之后再运行上面代码的时候 就都是报错: Call get_Value() failed with

timxx commented 1 year ago

sheet.Range('A1:B2').Value = [['a', 'b'], ['c', 'd']]

我试了最新的版本并不重现,你可以更新后试一下

12893822294 commented 1 year ago

更新了2.3.4版本,已经解决了