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
Post a Comment