Run Python Script from Excel VBA

preview_player
Показать описание
Support this channel, become a member:

🔥 Udemy Courses LOW COST Coupons/ Cupões Cursos Udemy BAIXO CUSTO 🔥:

With Udemy Courses you get/ Com Cursos da Udemy você terá:
♾️ Full lifetime access/ Acesso Vitalício Completo
📱📺 Access on mobile and TV/ Acesso no celular e TV
🏆 Certificate of completion/ Certificado de Conclusão

Here we will see how to execute a simple python script from Excel VBA.
Note: This will not change the excel data and also it will not read the excel data!

📚 Some useful books from Mike Driscoll 📚:

Other videos:

Playlists:

Follow me on Facebook

Or Twitter

#VBA #AllTech #Python #BASIC
Рекомендации по теме
Комментарии
Автор

🎅 Christmas Udemy Cupons 🎅 Ends in 1 day! 89% OFF!



🎅 Cupons de Natal 🎅 Termina em 1 dia! 89% de desconto!

AllTechPage
Автор

Hi. Just a tip. You have to declare each var in a line.
Dim exePath, scriptPath As String --> exePath is Variant, scriptPath is String.
The same with dates.
I like the style where you explain it simply and get to the point.
And I like that you're making Dim statements line before the first use and don't couple it to the start of the function.

songokussjcz
Автор

I *WORSHIP* you! No other example I found noted to include that space in the call!

Zardwark
Автор

Thank you for the help. A quick note would be that sometimes python script gives an error or cmd window closes without running the code. If you want to see the error you can add "cmd /k" to the start of the Shell.run like this:

Shell.Run "cmd /k" & " " & exePath & " " & ...

This helped me a lot so I am sharing :) Nice video series by the way, i was able to do my project.

eylulyurtseven
Автор

Great description and demonstration. Thanks.

JHatLpool
Автор

This is exactly what i needed, thank you

jon
Автор

Hello community, my code worked after I put three quotation marks at each side of either the Python executable path and the Python script path, regardless the presence or not of spaces between the characters.
Thanks for the sharing.
JPappalardo

julianopappalardo
Автор

Looking for the follow up video! I'd like store the results and modify the excel file using the stored results

srungeersimha
Автор

if I'm using Pycharm, how do I setup the start?

estanka
Автор

I read date from cell and passed the string to my python script via shell in VBA. One thing I had to do was put " " " " (x4) on each side of my date_string variable. This is because there is a space in the date_string variable. (Similar to file path with spaces). Then in my python script, I strip the extra quotes on the date_string variable. I use sys.argv[1].strip('\"') I thought this comment may help others.

ManuelHernandez-pqgy
Автор

Is there a way to modify Python script using VBA?

aadyabajaj
Автор

Hi

Getting run time error ‘429’

ActiveX component Can’t create object

Is there a way to solve this error

manupandit
Автор

How can I use python output(ex. days between dates) in excel vba?

semihakusbeci
Автор

Error: Method 'Run' of object 'IWshShell3' failed

arjunsatish
Автор

Mine runs successfully but it doesn't stop for user input like 3:13. So the command prompt appears on the screen less than a second maybe millisecond and then just closes itself. Because the command prompt closes itself so fast, it looks like the program doesn't do anything.

jumbo
Автор

hey i want to do the same in Mac OS, can you help me out

manojkumarsingh