@@SBHATY0U When do you get the error? When selecting the .bas file and importing it? What is the entire error message? Have you tried to run a quickstart project as shown in the video?
@@SBHATY0U Ok, but why would you like to replace the .bas file if it is working? As mentioned in the video, when creating a new project, you could include the xlwings .bas file to execute a Python file from Excel when mentioned in the video.
Hello, I'm trying to follow along with your video but i am getting the error "'xlwings' is not recognized as an internal or external command, operable program or batch file." when trying to quickstart
Thank you Praveen Urugonda, I'm happy to hear that you've been finding the videos useful. Thanks for taking the time to leave a comment and for watching!
Thanks for watching. You could transform your Python script into a standalone executable file. Here is one example from 'Python simplified': th-cam.com/video/Y0HN9tdLuJo/w-d-xo.html I hope this helps!
Amazing man. Can I ask u a question. So you show at minutes 9:05 on how to run the script from a folder "script". you define the python path as %%userprofile\dektop\scripts . But if you have to move the whole directory somewhere else, the scripts will not be working right? since the python path is fixed. Is there any way to define the python script relative to the "script" folder but without rechange/readjust the pyhton path again once we move the directory ?
Could you please help. Df = sheet.range('A1').expand().options(pd.Dataframe, index=False).value This is not taking in the entire data from excel if the first column has blank values. Any workaround to get whole data ?
Thanks for watching. You could try to use the "used_range" property on the Sheet object: docs.xlwings.org/en/stable/api/sheet.html#xlwings.Sheet.used_range Happy Coding! Cheers, Sven ✌️
Thanks so much for watching the video and leaving a comment! Your request is definitely noted. However, I get a ton of requests for custom solutions and, as much as I'd love to help everyone out, I just don't have the time in my schedule to develop and test all of them. I hope you can understand. Happy Coding!
I am getting the following error while using macOS and OneDrive: Error Traceback (most recent call last): File "", line 1, in TypeError: 'module' object is not callable. I tried the troubleshooting section of the xlwings page, but it is not obvious to me how to execute some of the troubleshooting sections of the page. I haven't figured out how to Add the directory of your Python source file to the PYTHONPATH-again, either via Ribbon or xlwings.conf sheet. Can someone please help me understand how to address this?
Hi, thanks for your helpful videos! The part starting at 12:07 seems to be the one relevant for me at the moment but I’m working with Jupyter Notebooks. I followed your instructions but Excel “Could not find interpreter!“ - can you help?
I have doubt . I created python file in anaconda environment. I can not able to run that code by giving in macro paths only. Can you guide how to run anaconda created python file in macro by giving their paths
Thank you very much for watching the video and your comment. Your requirements are well noted. Yet, I receive many requests for creating individual solutions. As much as I want to help, I simply do not find the time in my daily schedule to develop & test all the different requests. I hope you can understand. Thank you! Cheers, Sven ✌️
hello @codingisfun, when I try to make my code an EXE file using psgcompiler it gives me an error: 'Failed to execute script 'pyi_rth_win32comgenpy' due to unhandled exception: Module 'pythoncom' isn't in frozen sys.path' please help :)
Hi, instead of stackoverflow I am heading towards here :P , I got a question, I made in excel a bot with chromedriver which was getting me crypto/stock prices so to calculate my value of my portfolio. But since last it didnt work anymore saying chrome version 95 is not supported by this chromedriver. So I tried to install the latest version..I just replaced the old with the new one..it didn't worked but somehow in the evening all of sudden it did work, but now the fun part..Malwarebytes wanted to do a routine scan ..I said yes and It found malware.heurestic ..so it was a zero day something..so I am not sure now, is it safe to use the latest version of chromedriver, are there any issues with it? I do want a clean system, dont like to get compromised.
Hi ! Thanks a lot for your video ! It's great ! Maybe you can help me, I followed the same things you have done. First, i don't have any "xlwings" my ribbon, so I added one using : xlwings quickstart demo --addin --ribbon After that, every time i tried tu run the macro i got an error : Sub not define And I tried everything i knew it didn't works. Please can you help me ? In fact i already have a python script that I coded on my Windows Pc and I linked it to an excel file in order to run the code every time I push the button. I want to do the same on my Macbook and it driving me craizy cause it doesn't works Please !
Thanks for watching. How about starting with a quickstart project by running "xlwings quickstart myproject" first, and then use the generated Python file to adjust it to your needs. Happy Coding!
@@CodingIsFun thanks a lot for your message ! That's what i have done at least 10 times, but each time the VBA macro got a error : Sub is not define. I don't understand why cause i wrote the same code than you .... it's so annoying 😭
@@lockmaboc9416 I only have two possible fixes: 1) Ensure to activate xlwings. Open the VBA Editor, navigate to Tools -> References and tick the box for xlwings 2) Upgrade xlwings by running 'prip install xlwings --upgrade'
@@CodingIsFun I'm gonna try today thnajs a lot for your reply it help me a lot !! I have to do it for an important internship🤞🤞 hopefully it gonna works
Hi I am using vba to run a python script. However, the python script runs twice. Option Explicit Private Sub Worksheet_Calculate() Dim Ret_Val If Range("A1|).Value > 0 then Ret_Val = Shell("C:\Program Files\Python37\python.exe " & "F:\fut.py") End If End Sub In Cell A1 I have this formula COUNTIFS($J$28:$K$32,">"&$B$4)+COUNTIFS($J$18:$K$22,">"&$B$4)+COUNTIFS($J$38:$K$42,">"&$B$4) my python code import pyttsx3 engine = pyttsx3.init() engine.say(Hello How are you"') engine.runAndWait() what wrong am i doing? Thank you.
I am not sure why your code got executed twice. You might want to use the built in VBE debug tools to step into your code: www.screencast.com/t/KS9Xh4Lz Debug Video: th-cam.com/video/GGfvTFA7ZlI/w-d-xo.html
*I will be here in the comments section. For any issues, please provide your exact error message, and I will try to help.*
@@SBHATY0U When do you get the error? When selecting the .bas file and importing it? What is the entire error message? Have you tried to run a quickstart project as shown in the video?
@@SBHATY0U Ok, but why would you like to replace the .bas file if it is working? As mentioned in the video, when creating a new project, you could include the xlwings .bas file to execute a Python file from Excel when mentioned in the video.
Absolutely loved this, answered most of my questions. Thanks!!
Happy to hear that it was useful; thank you for taking the time to leave a comment and for watching the video! :)
Very good explanation! Thanks
Thanks for the positive feedback! Appreciate you taking the time to leave a comment. Cheers, Sven ✌️
Hello, I'm trying to follow along with your video but i am getting the error "'xlwings' is not recognized as an internal or external command,
operable program or batch file." when trying to quickstart
Hi Ojschoolz. Have you installed xlwings by running 'pip install xlwings --upgrade'?
Can we use custom python UDFs in all excel files like xlsx, and unsaved excel files as well?
Hi sir. Your videos are amazing sir
Thank you Praveen Urugonda, I'm happy to hear that you've been finding the videos useful. Thanks for taking the time to leave a comment and for watching!
Great video, any suggestions on how to make it so another user doesn't need python to run it on excel?
Thanks for watching. You could transform your Python script into a standalone executable file.
Here is one example from 'Python simplified':
th-cam.com/video/Y0HN9tdLuJo/w-d-xo.html
I hope this helps!
Amazing man. Can I ask u a question. So you show at minutes 9:05 on how to run the script from a folder "script". you define the python path as %%userprofile\dektop\scripts . But if you have to move the whole directory somewhere else, the scripts will not be working right? since the python path is fixed. Is there any way to define the python script relative to the "script" folder but without rechange/readjust the pyhton path again once we move the directory ?
Thanks for watching. You could use the Standalone option, as shown at 3:40 min and then keep the path flexible using VBA. Happy Coding!
Could you please help.
Df = sheet.range('A1').expand().options(pd.Dataframe, index=False).value
This is not taking in the entire data from excel if the first column has blank values. Any workaround to get whole data ?
Thanks for watching. You could try to use the "used_range" property on the Sheet object: docs.xlwings.org/en/stable/api/sheet.html#xlwings.Sheet.used_range
Happy Coding! Cheers, Sven ✌️
@@CodingIsFunThanks for replying. So used_range also did not work for me. I used current_region and it worked just right!
I just have a question: I have a table in a excel sheet, How i could insert a new row to put data in that new row inserted? Thanks a lot
Thanks so much for watching the video and leaving a comment! Your request is definitely noted. However, I get a ton of requests for custom solutions and, as much as I'd love to help everyone out, I just don't have the time in my schedule to develop and test all of them. I hope you can understand. Happy Coding!
Hi, thank you for the great tutorial. When I click the Run Main button, why does xlwings close my excel file and delete it from the folder as well?
Thanks for watching and for your question. Hard to tell from a distance why you are facing an error. Sorry that I cannot help.
I am getting the following error while using macOS and OneDrive: Error Traceback (most recent call last): File "", line 1, in TypeError: 'module' object is not callable. I tried the troubleshooting section of the xlwings page, but it is not obvious to me how to execute some of the troubleshooting sections of the page. I haven't figured out how to Add the directory of your Python source file to the PYTHONPATH-again, either via Ribbon or xlwings.conf sheet. Can someone please help me understand how to address this?
The error seems to be associated with the "-" in "OneDrive-Personal"
Hi,
thanks for your helpful videos!
The part starting at 12:07 seems to be the one relevant for me at the moment but I’m working with Jupyter Notebooks. I followed your instructions but Excel “Could not find interpreter!“ - can you help?
You might want to check if you have specified a Python interpreter path in your xlwings config file. Have a look at 7:24 min.
This content is just EXCELLENT. Thank you very much!
Glad you enjoyed the content. Thanks for watching the video and taking the time to leave a comment! :)
I have doubt . I created python file in anaconda environment. I can not able to run that code by giving in macro paths only. Can you guide how to run anaconda created python file in macro by giving their paths
Do you get any error messages? Is it working when you leave the python script in the same directory as the workbook?
Thank you for your reply
THANKSSSSSSSSSSSSSSS!!!!
My pleasure! Appreciate you taking the time to watch and leave a comment. 👍
Hello, how to use xlwings server in wsl system step by step instraction
Thank you very much for watching the video and your comment. Your requirements are well noted. Yet, I receive many requests for creating individual solutions. As much as I want to help, I simply do not find the time in my daily schedule to develop & test all the different requests. I hope you can understand. Thank you! Cheers, Sven ✌️
hello @codingisfun, when I try to make my code an EXE file using psgcompiler it gives me an error: 'Failed to execute script 'pyi_rth_win32comgenpy' due to unhandled exception: Module 'pythoncom' isn't in frozen sys.path'
please help :)
Thanks for watching. Hard to tell from a distance. Sorry that I cannot help
Hi, instead of stackoverflow I am heading towards here :P , I got a question, I made in excel a bot with chromedriver which was getting me crypto/stock prices so to calculate my value of my portfolio. But since last it didnt work anymore saying chrome version 95 is not supported by this chromedriver. So I tried to install the latest version..I just replaced the old with the new one..it didn't worked but somehow in the evening all of sudden it did work, but now the fun part..Malwarebytes wanted to do a routine scan ..I said yes and It found malware.heurestic ..so it was a zero day something..so I am not sure now, is it safe to use the latest version of chromedriver, are there any issues with it? I do want a clean system, dont like to get compromised.
Great question! ChromeDriver is actually open-source. I would consider it as safe to use 👍
after doing the quickstart I get a message bash is a directory. please help!
Is that the full error message? Can you cd to your desktop and try to run the quickstart command again?
Hello! Will xlwings work with the Microsoft365 version of Excel?
Yes
"xlwings' is not recognized as an internal or external command," my issue with the addin install
Did you install the library?? pip install xlwings
Thank you for your response, ya it installed correctly,but the add-in is showing problem's
@@slickbuyers Ok, then you might want to check out the following site: docs.xlwings.org/en/stable/troubleshooting.html
@@CodingIsFun ok thank you.
Hi ! Thanks a lot for your video ! It's great ! Maybe you can help me, I followed the same things you have done. First, i don't have any "xlwings" my ribbon, so I added one using : xlwings quickstart demo --addin --ribbon
After that, every time i tried tu run the macro i got an error : Sub not define
And I tried everything i knew it didn't works.
Please can you help me ? In fact i already have a python script that I coded on my Windows Pc and I linked it to an excel file in order to run the code every time I push the button.
I want to do the same on my Macbook and it driving me craizy cause it doesn't works
Please !
Thanks for watching. How about starting with a quickstart project by running "xlwings quickstart myproject" first, and then use the generated Python file to adjust it to your needs. Happy Coding!
@@CodingIsFun thanks a lot for your message !
That's what i have done at least 10 times, but each time the VBA macro got a error : Sub is not define.
I don't understand why cause i wrote the same code than you .... it's so annoying 😭
@@lockmaboc9416 I only have two possible fixes:
1) Ensure to activate xlwings. Open the VBA Editor, navigate to Tools -> References and tick the box for xlwings
2) Upgrade xlwings by running 'prip install xlwings --upgrade'
@@CodingIsFun I'm gonna try today thnajs a lot for your reply it help me a lot !! I have to do it for an important internship🤞🤞 hopefully it gonna works
I suppose this only woks on Excel 365.
Thanks for watching. No, it also works with other Excel versions
@@CodingIsFun Good to know, I'll give it a shot. Thanks.
Can there be a list validation using python
Thanks for watching the video. Yes, that is possible. See example below:
import xlwings as xw #pip install xlwings
wb = xw.Book('Book1.xlsx')
sht = wb.sheets['Sheet1']
rng = sht.range('A1')
validation_list = "Ahoy, From, Coding, Is, Fun"
dv_type = xw.constants.DVType.xlValidateList
dv_alertstyle = xw.constants.DVAlertStyle.xlValidAlertStop
dv_operator = xw.constants.FormatConditionOperator.xlEqual
rng.api.Validation.Add(dv_type, dv_alertstyle, dv_operator, validation_list)
Hi I am using vba to run a python script. However, the python script runs twice.
Option Explicit
Private Sub Worksheet_Calculate()
Dim Ret_Val
If Range("A1|).Value > 0 then
Ret_Val = Shell("C:\Program Files\Python37\python.exe " & "F:\fut.py")
End If
End Sub
In Cell A1 I have this formula COUNTIFS($J$28:$K$32,">"&$B$4)+COUNTIFS($J$18:$K$22,">"&$B$4)+COUNTIFS($J$38:$K$42,">"&$B$4)
my python code
import pyttsx3
engine = pyttsx3.init()
engine.say(Hello How are you"')
engine.runAndWait()
what wrong am i doing?
Thank you.
I am not sure why your code got executed twice. You might want to use the built in VBE debug tools to step into your code:
www.screencast.com/t/KS9Xh4Lz
Debug Video: th-cam.com/video/GGfvTFA7ZlI/w-d-xo.html