Python Comptypes错误“无效大小的数组传递给xxx”

问题描述

我在Python中使用Comtypes。我是Python新手。 我在Python的Comtypes中使用的COM对象在Excel VBA中运行良好。 我尝试在Python中使用的COM对象的语法在VBA中的工作方式如下:

object.mymethode1(vba_array_of_defined_size) 'it takes as argument of an array of defined size then does something else 
object.mymethode2(vba_array_of_defined_size) 'it takes as argument of an array of defined size then change directly the value of this array

我尝试在带有Comtypes的Python中使用相同的语法,但是这两种方法都不起作用

错误消息下方:

COMError: (-2147221503,'Invalid advise flags',('Invalid sized array passed to mymethode','com_object_name',None,1000440,None)) 

有人知道吗?非常感谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)