Passing several variables from Excel to Python with XLwings -


i have same question post multiple variable (and macro instead of function) (passing variable excel python xlwings)

i try

sub hello ()     dim name,name2 string     runpython ("import test; test.sayhi('" & name1 & " , " & name2 & "')") end sub 

but error :

--------------------------- error --------------------------- traceback (most recent call last):    file "<string>", line 1, in <module>  typeerror: sayhi() missing  required positional arguments: 'name2'  

how overcome error plz ?

thanks help

your string resolves single argument. fix single quotes this:

runpython ("import test; test.sayhi('" & name1 & "' , '" & name2 & "')" 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -