2

I have a question about calling a Python script in my Excel VBA function. For instance, in my Excel VBA function, I have: abc(x,y,z). In this function, I will pass x,y,z to my Python script as input. Python output will then return calculation result to my abc() function. What I want to achieve is as follows:

    function abc(x,y,z)
    ' here x, y, z is the input that will pass to Python
    ' then we call python scripts here with the return value h
    < call Python here>
    abc=h
    end function 

My question is:

  1. How to pass x,y,z to Python scripts?
  2. How to give my return value h to abc()?
SiHa
  • 7,830
  • 13
  • 34
  • 43
Hao Zhang
  • 257
  • 3
  • 4
  • 15
  • Possible duplicate of [How do you pass a value from VBA to python](http://stackoverflow.com/questions/10831771/how-do-you-pass-a-value-from-vba-to-python) – PyNEwbie Nov 23 '15 at 20:51
  • If you look to the right below the adds you will see similar questions with answers. I would encourage your to look at those – PyNEwbie Nov 23 '15 at 20:52
  • Possible duplicate of [Return result from Python to Vba](https://stackoverflow.com/questions/39516875/return-result-from-python-to-vba) – fatih_dur Mar 12 '19 at 01:57

0 Answers0