How to get VBAs ByRef return from Python over COM

72 views Asked by At

(I'm no good in English sorry...)

I want to get value in VBA using ByRef parameter from Python. Because I need to return several values from VBA.

example.

' VBA
Sub GetValue(ByRef v As Variant)
    v = "some cell value"
End Sub 

#Python
#app is Excel.Application
v = ''
app.Run('GetValue', v)
Print(v)

I tried using xlwings and win32com but v comes initial value ''.

Similar code by PowerShell was succeeded. I have no idea to solve. Someone teach me please.

Thanks.

0

There are 0 answers