Problems with the dynamicCall method usage in the QAxWidget class
-
Development environment:Python3.11+PySide6 6.6.1
Word document is displayed via QAxWidget embedding, and a syntax error is always prompted during the use of dynamicCall, with the error message "Unexpected Type: (str, str) Possible Type: (bytes, Any)(bytes, Sequence)". The code is as follows, please see what the problem is?doc_path = "C:\Path\To\Your\Document.docx"
self.word_widget.dynamicCall("Documents.Open(const QString&)", doc_path)
-
@howerl
Just this was asked the other day, there will be a recent thread for this maybe a week ago. the sad upshot was that it appears to be a PySide issue, with currently no known fix. I asked the other poster to try with PyQt instead of PySide and it worked fine....EDIT
It's https://forum.qt.io/topic/152615/why-does-calling-dynamiccall-and-querysubobject-always-get-an-error-in-qaxwidget , and you were the poster, though you don't even reference that from here which would at least have been helpful. So you already know the answer, what's the point of this new thread? You know what the problem is, and you know there is apparently no solution with PySide6, so....Have you reported this on the Qt bug tracker? You really need a Qt PySide developer to have a look at this issue.