ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

Use Python to replace VBA in Excel

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 พ.ย. 2020
  • Did you know that you can completely replace VBA in Excel with Python?
    Script and automate Excel using nothing but Python, and write macro functions (Subs) and worksheet functions (UDFs) using PyXLL.
    PyXLL
    www.pyxll.com
    Resources for VBA developers
    www.pyxll.com/...

ความคิดเห็น • 266

  • @5StarsLuis
    @5StarsLuis ปีที่แล้ว +6

    As a Python dev, I really do appreciate staying in 1 language for development, especially when I produce some of my reports in Excel using Python. Now it looks like I can also include "embedded Python" aka Excel macros written in Python in my reports! Excellent!

  • @Simaq7
    @Simaq7 3 ปีที่แล้ว +7

    Many thanks for this video. I wanted to study Python and since I use excel spreadsheets daily, I then switched to VBA about 6 days ago. This was because I was unaware that one could "import" PYXLL into excel. My main goal was learning Python since I'm interested in both Data Analysis and Machine Learning. Your video just switched me over to Python.
    Once again, THANK YOU SO MUCH. I'm now a subscriber

    • @python-excel
      @python-excel  3 ปีที่แล้ว

      Great to hear! Thank you :)

  • @RS-tx4bu
    @RS-tx4bu 2 ปีที่แล้ว +2

    This is simply amazing! Having the power of Pandas, Numpy, lists, dicts, regex, requests, multithreading, ML, ... and the easier than VBA Python syntax ... ALL now available inside Excel. I hope there will be something like this for MS Access as well someday. This is a game changer and you get the best of both worlds.
    Some wise man once said: "Learn a new language, get a new life."
    Hope you keep making many more videos like this.

  • @yacinegacem9923
    @yacinegacem9923 3 ปีที่แล้ว +15

    One of the many: "Thank you!"
    Finally we got Python presented in Excel itself. Basically a hurdle less to embrass Python.

  • @byteseq
    @byteseq 3 ปีที่แล้ว +42

    1. VBA does not usually index from 1 !
    2. This is still miles from being as convenient and shareable as things made in VBA.

    • @andyrobertson4096
      @andyrobertson4096 3 ปีที่แล้ว +1

      There is 'option base' isn't there. You can set the base number for arrays.

    • @byteseq
      @byteseq 3 ปีที่แล้ว +2

      @@andyrobertson4096 yes, but 0 is still the standard

    • @TheLenbus
      @TheLenbus 3 ปีที่แล้ว +2

      @2. maybe you are right in terms of sharing, but in my opinion nowadays nothing beats the readability and extensibility of python code. It would be cool to see native Python-support embedded into Office Macros.

    • @4us2grow
      @4us2grow 3 ปีที่แล้ว +1

      Have you tried xlwings?

    • @logic3686
      @logic3686 3 ปีที่แล้ว +1

      Totally agree. Not understanding how this is better than having the code written into the workbook you are giving someone to use.

  • @gokulnaththeboss08
    @gokulnaththeboss08 3 ปีที่แล้ว +107

    Dude there is a market demand where u can use python with excel in area of auditing /accounting where no one is teaching. I hope u start a series a based on those topic which would be so useful

    • @luisfernandocuestasanchez4343
      @luisfernandocuestasanchez4343 3 ปีที่แล้ว +1

      Thank you for sharing that

    • @stevenmoore9805
      @stevenmoore9805 3 ปีที่แล้ว +3

      Are you serious? There is a market for python/excel in accounting?

    • @gokulnaththeboss08
      @gokulnaththeboss08 3 ปีที่แล้ว +6

      @@stevenmoore9805 yup but sad no one teaching these type of programming area for accountants

    • @Jeevaji14
      @Jeevaji14 3 ปีที่แล้ว

      It's great video

    • @sanjaysharma-it9wl
      @sanjaysharma-it9wl 3 ปีที่แล้ว

      Can you give me reference on your statement. Because what I am hearing from you is unique. Just wanted to confirm that how you arrive on this statement. and eager to discuss with you if allow

  • @dansam1395
    @dansam1395 3 ปีที่แล้ว +43

    It is a very interesting extension... but I don’t get the reason why it is offered as subscription, and why it is so expensive.

  • @venusflytrap909
    @venusflytrap909 3 ปีที่แล้ว +24

    VBA is just fine - if it aint broke then dont mess with it - the final python structure is not easily readable - VBA is well suited to Xcel - it's inbuilt and right there to start using with no add in requirements or seperate packages and buttons or loading modules, all very time consuming and more things to go wrong - if microsoft ever drop VBA it will be the worst decision they ever make.

    • @john1956c
      @john1956c 3 ปีที่แล้ว +6

      I agree. I do a lot of scripting in VBA and although it is no where near as flexible and easy to use as Visual Studio (Visual Basic) at let we have the tool within Excel to do these things. The video only helps someone that has Python experience and doesn't want to learn VBA.

    • @AxelTag
      @AxelTag 3 ปีที่แล้ว +8

      If Python were integrated to Excel you wouldn't say that. After a few programs maded in Python you can notice the diferences.

    • @john1956c
      @john1956c 3 ปีที่แล้ว +1

      @@AxelTag - Yea, well Microsoft won't change that. VBA is antiquated, but it does the job for what the user wants to do. They just need to know how to do it. Of course a Python user would prefer it in there as they are used to coding in it. I would prefer that C# was supposed, but it isn't.

    • @afonsosnow2192
      @afonsosnow2192 3 ปีที่แล้ว +2

      Python is beautiful, VBA works well in excel and I think that MS will not drop VBA by python both can and should coexist.
      But think of the thousands of libs python has and the power it can give to excel ...

    • @hermanheunis9354
      @hermanheunis9354 3 ปีที่แล้ว

      Agree 100%. I managed a whole factory dried fruit intake for two seasons with VBA. Programming is situational and VBA works out of the box in the office with Office. Python of course has its place and is very powerful, I run a Kivy App that measures productivity and sends the data to an off-site server, but unless your IT department starts installing Python on all the office pc's VBA can do everything you need. There is a guy from Wise Owl tutorials that even wrote a game in VBA that runs on a Spreadsheet.

  • @jg2077
    @jg2077 3 ปีที่แล้ว

    And here is that other video I promised th-cam.com/video/uEgJLLHBlZU/w-d-xo.html
    This one automatically organizes music album files into their respective and automatically created folder. And it does this for all the alubms. So amazing to see it execute and do it all automatically. Hopefully I have this walk through video for other users and anyone who is interested in Windows Automation. Let me know if you get any questinos that I can help with.

  • @NewStreamLine
    @NewStreamLine 3 ปีที่แล้ว +5

    Interesting. But I'm familiar with VBA and I think I'll stay with it. No need to use many different tools to get one thing working.
    Anyways, Python users might like that way of doing things.

  • @logic3686
    @logic3686 3 ปีที่แล้ว +1

    I see a lot of examples of using commands that reference changing the cells directly which is the slowest way of changing sheet data. I'm struggling to see how this is a replacement of VBA especially seeing how this is requiring an end user to use another type of program that they don't inherently have installed with windows whereas I can easily have buttons for them to run code in the spreadsheet of the same workbook I give them.

  • @cyberhome101
    @cyberhome101 3 ปีที่แล้ว +8

    Have you done a speed comparison?

  • @GerryStilton
    @GerryStilton 3 ปีที่แล้ว +1

    I love the possibilities of PXLL but the pricing on the license is on annual basis and that becomes pretty steep at $240/ seat in a team of 10 and it stops working as soon as the licenses expire...got to make the pricing more attractive but at the same time I understand you're trying to make a living too. Great product with great use case but may be lower the pricing? Modify the licensing model? Tough call.

  • @HardieYe
    @HardieYe 3 ปีที่แล้ว +1

    VBA is much much convenient. Doesn't need to install any plugins

  • @Kapildevkushwah
    @Kapildevkushwah 3 ปีที่แล้ว +10

    I will give VBA priorty over python for excel use because u can record the codes even without knowing it.... We can not do recording in python we have to learn codes....

    • @krzysztofgie7936
      @krzysztofgie7936 3 ปีที่แล้ว

      Recording should be banned. Macro recorder is responsible for a lot of garbage code.

    • @logic3686
      @logic3686 3 ปีที่แล้ว +1

      @@krzysztofgie7936 LOL, I would agree but they can be useful for beginners staring out using the VBA interface.

  • @WoottonRivers
    @WoottonRivers 3 ปีที่แล้ว +7

    I write a lot of VBA Excel code. The problem with VBA is that it doesn't run in online or smartphone versions. Will this solve this problem?

    • @FlowerBot
      @FlowerBot 3 ปีที่แล้ว +1

      use Office Scripts for office online

    • @davescott7680
      @davescott7680 3 ปีที่แล้ว +1

      Doesn't the Add-ins written in JavaScript solve that problem?

    • @goombakiwi
      @goombakiwi 3 ปีที่แล้ว

      MS going to Javascript/Typescript.

  • @chrislow123
    @chrislow123 3 ปีที่แล้ว +1

    Very educational....but why use Python over VBA in a workbook?
    Just looks like additional work and learning to me

  • @Riddingwithvivian
    @Riddingwithvivian 3 ปีที่แล้ว +1

    Well done...excel might be the preferred platform for executing program code if it isn't already. That is good for me considering I have made a career around the program.

  • @martinriedel1911
    @martinriedel1911 3 ปีที่แล้ว +7

    Great video! Can you clarify what the big benefit of using Python over vba is? Is it faster to execute, or can it run i paralell etc?

    • @lotuskillerlp4736
      @lotuskillerlp4736 3 ปีที่แล้ว

      I guess python provides more opportunities to interact with different platforms. Moreover if yoyr are used to python its much easier to continue instead of learning vba which could be quite uncomfortable as i think.

    • @mr.RAND5584
      @mr.RAND5584 3 ปีที่แล้ว

      Concise, easy to read.

    • @kevinl.9657
      @kevinl.9657 2 ปีที่แล้ว

      If you want to do everything inside Excel, VBA is great. But if you want to connect things to Excel, for example, getting data from web scraping, putting it into a SQL database, putting it into excel, transform data, create an interactive visual report or interactive GUI, then compared to VBA, Python is better.
      TLDR; If you only care to do things inside Excel, VBA is fine. If you want to do something outside and inside Excel, Python is the way to go.

  • @yeknafaskesh1257
    @yeknafaskesh1257 3 ปีที่แล้ว +2

    EXCELLENT - That was great and VERY well made. Thank you very much.

    • @python-excel
      @python-excel  3 ปีที่แล้ว

      Thanks! Glad you liked it :)

  • @Esclarecidos
    @Esclarecidos 3 ปีที่แล้ว +1

    Do you know if it's possible to use an alternative VBA editor in Microsoft Office applications? The problem with the default VBA editor for Office is that on high resolution monitors it is impossible to increase the font size to the code area. I tried changing the font size on the menu TOOLS - OPTIONS - EDITOR FORMAT, but it didn't work. The command wasn't accepted. Somehow the font size to code area in default VBA editor is directed related to monitor resolution.

  • @cswalker21
    @cswalker21 3 ปีที่แล้ว +2

    I thought I heard a few years ago a rumor that JavaScript was going to replace VBA in Excel. Python seems like a better fit.

    • @goombakiwi
      @goombakiwi 3 ปีที่แล้ว

      Excel now incorporates Typescript(Javascript).

    • @cswalker21
      @cswalker21 3 ปีที่แล้ว

      @@goombakiwi Interesting. Thanks for the clarification.

    • @tt9378
      @tt9378 3 ปีที่แล้ว

      @@goombakiwi Really, does it need an add on? Just wondering if my company would allow it. My mind is racing at all the shadow IT I and many others in the company could create.

    • @tt9378
      @tt9378 3 ปีที่แล้ว +1

      Just did a quick check and you have to have scripts switched on by an administrator. So that is a big fat NO from my company, allowing us to use typescript, Boooo 😂.

  • @CosmicBarrilet
    @CosmicBarrilet 3 ปีที่แล้ว

    Suscribed. Gonna curious inside the channel . Great vid, from a Python begginer.

  • @DavLim86
    @DavLim86 3 ปีที่แล้ว +1

    Quick question, if the code were to run directly from python, do the user still need to enable macro in the Excel instance?

  • @kenthomson9562
    @kenthomson9562 3 ปีที่แล้ว +7

    If I were to send my excel file which includes python code, would all the recipients also need to buy/install python platform?

    • @python-excel
      @python-excel  3 ปีที่แล้ว +2

      Any functions will need your Python code to be able to run, and so will also need the PyXLL add-in installed. If the person you are sending the file to doesn't need to recalculate anything just view the results then they don't need anything. Check out support.pyxll.com/hc/en-gb/articles/360036822253-I-want-to-share-my-work-with-others-Do-they-need-PyXLL-and-Python- for more information about this.

    • @kenthomson9562
      @kenthomson9562 3 ปีที่แล้ว

      @@python-excel Thanks.

    • @scottparker6869
      @scottparker6869 3 ปีที่แล้ว +4

      So python can do the same as VBA, why is python special?

    • @archardor3392
      @archardor3392 3 ปีที่แล้ว

      @@scottparker6869 It is only special if you already know Python and don't have time to learn VBA but wouldn't mind dropping a bit of money. The reasonable course of action would be to learn VBA tbh, but if you really can't stand it, I would understand going to any lengths to avoid it.

    • @horseshoecrabs2000
      @horseshoecrabs2000 3 ปีที่แล้ว

      @@archardor3392 Python has an incredible array of powerful libraries available to it that go above and beyond what VBA is capable of doing natively. One thing I immediately thought about after this video is that I could use the AWS Wrangler library with Python and push a spreadsheet directly to the S3 layer without having to exit the spreadsheet, call the python script, then reload the spreadsheet. Your workflow can exist solely in the Excel environment. That's very powerful. Other features of Python such as numpy and scipy for statistical analysis and scripting would allow for the creation of functions that would be too unwieldy for Excel's engine to handle well. Or you could do web-scraping and dump tables directly into a worksheet. This is a neat tool.

  • @Joske920
    @Joske920 3 ปีที่แล้ว +22

    29$/month ... really? thats to much for playing arround

    • @andressolar517
      @andressolar517 3 ปีที่แล้ว +4

      try LibreOffice with APSO plugin.

    • @vivetytwo3205
      @vivetytwo3205 3 ปีที่แล้ว +1

      An absolute rip-off and hostage taking. Use xlwings. It's free.

  • @trickydickybeer1
    @trickydickybeer1 3 ปีที่แล้ว +12

    Interesting would the file work on other pcs without any installations

    • @davescott7680
      @davescott7680 3 ปีที่แล้ว +7

      Nope. And that's one of the main reasons why I still use VBA almost daily, it's super transportable. I wish MS would make it so JavaScript or something could natively run from within a file. They already allow it as a web app, but that then requires hosting and other permissions and keys from IT.

    • @linomorin7682
      @linomorin7682 3 ปีที่แล้ว +1

      You just need to have a python interpreter installed on the machine and all the modules installed as well

    • @thefamousdjx
      @thefamousdjx 3 ปีที่แล้ว

      I always hear this argument but people can always install extra programs, same way they would have installed Excel. Python brings more modern capabilities

    • @houstonvanhoy2198
      @houstonvanhoy2198 3 ปีที่แล้ว

      the famous djx:
      Yes, people can install other software if enterprise IT allows it. That is not always the case.

  • @excelmastervba
    @excelmastervba 3 ปีที่แล้ว +1

    WOW, this is awesome! 🚀🚀 I need to try that immediately 😄

  • @k_bv
    @k_bv 3 ปีที่แล้ว

    I came to Python from VBA. My opinion is if you are beginner and you need just some macros to make your life easier in Excel, you don't need Python. I miss a lot VBA debugging tools, believe me when you start, you will need them. If you are average user I don't think that you will reach VBA limits. Where Python shines are array operations, this is at least what I see for now, after my short Python experience. May be later I'll could say more.

    • @ajayrathod7777
      @ajayrathod7777 7 หลายเดือนก่อน

      Now what is your view can I do incredible report generation using python?

  • @johnmcmanus6719
    @johnmcmanus6719 3 ปีที่แล้ว +3

    Can't wait till they have this for SAP

    • @Mpmichi
      @Mpmichi 3 ปีที่แล้ว +2

      Incase you mean interacting with sap gui via python, there already is. Just search for SAP Gui scripting python.

    • @tizcoloko
      @tizcoloko 3 ปีที่แล้ว

      python has the db connector for sap java since nw03 and python odbc, now we have the db connector for python 3.8 for hana.

  • @accountingsapayag
    @accountingsapayag 3 ปีที่แล้ว +2

    I don't think Python will ever replace VBA in Excel. When I first studied VB in the mid 2000's VB6 came in... and the that was the last of the VBs because .NET came. VB.NEt which was very different although similar to VB6. It didn't even replace VB6. There were good arguments there that experts said that there was no urgent reason to jump from VB6 to VB.NET. Python won't be any different. Power Query adds to VBA in Excel and SQL has always been there to manipulate data with Excel(only a few knows... and those who know won't ever feel there's a need for Python in Excel). Last reason, You have to convince those who have invested in VBA since time immemorial and tell them Python would be better while I go grab my popcorn and watch. These were similar to those people who didn't even budge when VB.NET came. But great creation mate... kudos.

  • @vince8520
    @vince8520 3 ปีที่แล้ว +5

    It's very interesting, but I still like VBA better, sorry. And I'm sure there is a point where VBA is not replaceable.

  • @vardansahakyan9805
    @vardansahakyan9805 3 ปีที่แล้ว +2

    Why?
    Why should i replace native VBA, a powerful, robust and yet simple tool with this?

    • @sausagesmcgee7079
      @sausagesmcgee7079 3 ปีที่แล้ว

      because VBA was fine in the 90s but it's really awful now

  • @chulakapitigala5147
    @chulakapitigala5147 2 ปีที่แล้ว +1

    Wow that's awesome 😎❤️

  • @neerajaggarwal4689
    @neerajaggarwal4689 3 ปีที่แล้ว +4

    Great video!!!!
    But I have one problem. My clients needs VBA code to execute code. I can convince him to run run it with python but he needs to install python, jupyternotebook, pyxll etc.
    Is there any easy way to do this?

    • @python-excel
      @python-excel  3 ปีที่แล้ว +1

      You can build a single installer that includes your code, Python and anything else you need. Take a look at www.pyxll.com/docs/userguide/distribution.html#building-an-installer.

    • @neerajaggarwal4689
      @neerajaggarwal4689 3 ปีที่แล้ว +1

      @@python-excel Thank you for your reply. I will try to do the same thing. Hope it will help😀

    • @christianheffner92
      @christianheffner92 3 ปีที่แล้ว +1

      Still do not see reason to use python instead of vba for this. Vba is installed in basically every computer, easy to use. Python just complicates things

  • @mikelennon1078
    @mikelennon1078 3 ปีที่แล้ว

    Wondering for a person not knowing much about Codes, which code is easier to learn and use specially if the main interest is creating Relational Databases and or CRMs? VBA or Python or any other .

  • @phuongvom
    @phuongvom 3 ปีที่แล้ว +4

    Thanks for your sharing. But if you want to share great content, please change the console color to white so that your code will be easier for reading. In brief, please image you are user reading your content, it should be comfortable to read. And some users like me is not a big fan of dark screen like that. In your content, it is dark screen, the text is also in dark color....

  • @josedimastovar266
    @josedimastovar266 3 ปีที่แล้ว

    Espero poder aprender mucho mas con lo.que realiza ...gracias por.compartir sus conocimiento

  • @romanverner
    @romanverner 3 ปีที่แล้ว

    This is amazing. Thanks for posting this!

  • @luigidb
    @luigidb ปีที่แล้ว

    Thanks a lot, you're very very clear. Just a question: if I want deploy python stuff to install as a package on other pc different than mine ... what I have to do? Can you explain it with a video on this subject? Thank you again.

    • @python-excel
      @python-excel  ปีที่แล้ว

      Hi Luigi! This FAQ article should help with that support.pyxll.com/hc/en-gb/articles/360036822293-How-can-I-distribute-my-PyXLL-functions-to-other-users-. If you need any more help with that then just reach out to our support via the website 👍

  • @rameshd468
    @rameshd468 2 ปีที่แล้ว +1

    Many many Thanx

  • @hiepnguyen220
    @hiepnguyen220 3 ปีที่แล้ว

    If I built a huge library of Visual snippets. Is there any apps out there help converting from Visual to that¿

  • @JI9131
    @JI9131 3 ปีที่แล้ว

    i did not find a reason why need to use Python to replace VBA in this case, which scenario we are talking abut to apply this?

  • @bogdanexit1
    @bogdanexit1 3 ปีที่แล้ว

    Vba is faster (only if in python you don't use numpy ) , simple and accessible with no restriction in lot of company

  • @RajnishDubey1988
    @RajnishDubey1988 3 ปีที่แล้ว

    how to call/execute excel macro using ( Java, .Net, Python) on server-side, where ms office is not installed??

  • @dadisuperman3472
    @dadisuperman3472 ปีที่แล้ว

    What is that Qt button for?

  • @2hockeystixneil
    @2hockeystixneil 3 ปีที่แล้ว +1

    Is there a difference between the two languages? Is python better than VBA for excel? Im just wondering because im currently learning vba and was thinking about learning python instead. Great video btw!

    • @python-excel
      @python-excel  3 ปีที่แล้ว +3

      Haha well that's a very good question :) I would of course say that Python is much better but I am biased! What I would say is that there is far more of an ecosystem of packages available for Python than for VBA, and Python is more 'generally' useful since you can run it both inside and outside of Excel, whereas VBA you're stuck with using it in Excel (or other Office tools). Thanks, glad you enjoyed the video :)

    • @shobhitnsaxena
      @shobhitnsaxena 3 ปีที่แล้ว +4

      @@python-excel I agree with you for your preference of Python over VBA but my perception is little different, in excel VBA is very easy and I learned by my own without anyone's help but for Python we need to go for proper course to learn and more over VBA is very easy for excel we can do anything. Now I am using python just to get the live data updates, which is also available in VBA............. But still we can not compare Python and VBA both are completely different...

    • @KentBrakewell
      @KentBrakewell 3 ปีที่แล้ว

      The loss of intellisense features is a huge drawback. Is there a work around?

    • @7H0M4591
      @7H0M4591 3 ปีที่แล้ว +2

      VBA is extremely powerfull, but you will hardly find any libraries like you do on Python.
      Nevertheless I did not discover any problem so far, that I couldn't solve by VBA. The only thing that comes on my mind is that VBA isn't able to use mulitthreading. There is a workaround, but it's not stable!

  • @mikelennon1078
    @mikelennon1078 3 ปีที่แล้ว

    Wondering for a person not knowing much about Codes, which code is easier to learn and use specially if the main interest is creating Relational Databases and or CRMs? VBA or Python or any other ? Any chance you might have a sample file to see how it looks?

    • @houstonvanhoy2198
      @houstonvanhoy2198 3 ปีที่แล้ว +1

      Mike Lennon:
      You might want to research Access, the desktop database that refuses to die. Like Excel, it has a huge installed base of applications in many companies and a corps of devoted developers. Sort of like COBOL, except that COBOL practitioners are retiring in droves with no one to replace them.

  • @hapablap2088
    @hapablap2088 2 ปีที่แล้ว

    Im using excel for school, If i change it to use python instead of VBA, what happens when I send the excel to the prof? Will it only work if he has the same software? Or will the excel file I sent to them just have python in it?

  • @saurabhtalele1537
    @saurabhtalele1537 3 ปีที่แล้ว

    Good concept pyxl awesome sir

  • @casual_gamer1413
    @casual_gamer1413 2 ปีที่แล้ว

    I'm a python web scraper and I have good grip on python, so, Should I go for VBA or continue with the python to handle excel problems?

    • @python-excel
      @python-excel  2 ปีที่แล้ว

      For web scraping Python is far more capabale, IMHO. Imagine trying to reimplementbs4 in VBA!!

  • @nadimkhan-lm3ki
    @nadimkhan-lm3ki 3 ปีที่แล้ว

    This is amazing. Thanks for posting this!
    But I have a question I have huge VBA code and I want to convert it
    into python -- Reason because VBA is very slow it takes time. please help me to convert this VBA to python .. need your help ..

  • @realbigbear
    @realbigbear 2 ปีที่แล้ว

    What are the benefits to replace VBA with Python in Excel? Better performance?

  • @setyoufree2726
    @setyoufree2726 3 ปีที่แล้ว +1

    since you said we can replace VBA with Pyxll (python), how about user form in excel which controlled using VBA, can we execute that user form response using python also? similar with VBA?

    • @python-excel
      @python-excel  3 ปีที่แล้ว

      Yes, you can create user interfaces using PyXLL too. Please see www.pyxll.com/docs/userguide/ctps/index.html for details!

    • @setyoufree2726
      @setyoufree2726 3 ปีที่แล้ว

      @@python-excel - I will check it. Thanks for sharing your knowledge.

  • @kofimensah6566
    @kofimensah6566 3 ปีที่แล้ว

    Very Nice! Please do some tutorials on graphs!

    • @python-excel
      @python-excel  3 ปีที่แล้ว

      Thanks! Take a look at the PyXLL docs here www.pyxll.com/docs/userguide/plotting/index.html for details of how you can use Python graphs in Excel.

  • @uncommonsense360
    @uncommonsense360 2 ปีที่แล้ว

    Do workbooks still have to be macro-enabled using PyXLL? Because if this can avoid macro enabling, that would add lots of security to Excel.

    • @python-excel
      @python-excel  2 ปีที่แล้ว

      There's no need for the workbooks themselves to be macro enabled as the PyXLL macros run as part of the PyXLL add-in. As long as the PyXLL add-in is trusted then its macros will be enabled.

    • @uncommonsense360
      @uncommonsense360 2 ปีที่แล้ว

      @@python-excel so I assume this wouldn't run if shared with someone else?

    • @python-excel
      @python-excel  2 ปีที่แล้ว

      @@uncommonsense360 You would also need to share your Python code and the other user would need PyXLL. Please see this FAQ for more details on this support.pyxll.com/hc/en-gb/articles/360036822253-I-want-to-share-my-work-with-others-Do-they-need-PyXLL-and-Python-

  • @jezreelmoraes5864
    @jezreelmoraes5864 3 ปีที่แล้ว +4

    This is so cool, thanks for sharing

  • @jorgesousavieira1817
    @jorgesousavieira1817 3 ปีที่แล้ว +1

    Why would anyone choose to use Python instead VBA?, without the VBA IDE you have to remember in memory each property and method and usage of the object model, besides to write by hand all those kilometric commands in the console. Is the same you choose to use Linux instead Windows for PRODUCTIVITY WORK.

  • @big1975E
    @big1975E 3 ปีที่แล้ว

    Can python code be written to do the kinds of things that can be done using VBA but for Excel online?

  • @andikanmfon5960
    @andikanmfon5960 3 ปีที่แล้ว

    I have successfully installed pyxll and even included the pyxll add-in in my excel, but anytime I try to launch the jupyter note book in excel
    , I get a 'PyXLL: Ribbon Error' that states ' Error calling pyxll_jupyter.pyxll.open_jupyter_notebook'.
    Where am I getting it wrong please?

  • @mr_slave
    @mr_slave 3 ปีที่แล้ว

    Is there a possibility to choose which one we want to use every time we enter it? I'm working with vb in collage but I would like to try working with python cause I think it gives more possibilities? Anyone knows?

  • @vanaraja5812
    @vanaraja5812 3 ปีที่แล้ว

    Ultimate buddy.! 😍😍😍

  • @RichardPeterShon
    @RichardPeterShon 3 ปีที่แล้ว

    Python is like an improved version of Basic, so it is inevitable python would come onboard oneday.

    • @sajeerks1708
      @sajeerks1708 3 ปีที่แล้ว

      Why bother python coding. Already macro function is there. So isn't enough to use with a mouse click. Please share the use of python🤔

  • @patrickmullot73
    @patrickmullot73 3 ปีที่แล้ว +5

    What’s the point of that? You’re just using the Excel API.
    What would be a real life scenario (in an actual enterprise) where using Python could bring some benefits?

    • @markippo
      @markippo 3 ปีที่แล้ว +1

      Honestly everything what you're allowed to do in your operating system. Not only what MS allowed you to do in vba sandbox. You can extend Excel capabilities using python's statistical or AI libraries with easy integration with Excel's data model. You can create automated, interactive, easy to read reports and so on. Yeah of course, if you want to take some data from spreadsheet or put them into, you need to use Excel's API, but in between you can utilise full python potential. Finały - as a script language python is more user friendly and flexible. You've got tons of libraries. Typing is dynamic. You've got lists, dictionaries, sets, tuples, implement objec oriented approach if you want. You can create generators, iterate via multiple stuff at once.

    • @patrickmullot73
      @patrickmullot73 3 ปีที่แล้ว

      Thanks for answering! There is no doubt that python is way more powerful in any sense than VBA, but I still think that if you need such power for your use case, you’re much better off importing the data from the Excel sheet using pandas in a Jupiter notebook (or Google collab). If you need presentation, python has tons of libraries for that, and you can still export your output data to excel.
      If you just want to do simple stuffs inside Excel, usually vba is enough.

  • @jorgeramiroalarconvargas2580
    @jorgeramiroalarconvargas2580 3 ปีที่แล้ว

    why do I get ipython into excel, when a jupyter notebook can make all that and more?

  • @JHatLpool
    @JHatLpool 3 ปีที่แล้ว +1

    Really good. Thanks for posting.

  • @life_in_gen
    @life_in_gen 3 ปีที่แล้ว

    Hi Sir, After you develop your own macro in Python how do you go about using this macro on other machines? Or your co-workers to use it as well. Thank u in advanced.

    • @python-excel
      @python-excel  3 ปีที่แล้ว

      Hi! There are a few different good ways to do that. This FAQ article explains more support.pyxll.com/hc/en-gb/articles/360036822293-How-can-I-distribute-my-PyXLL-functions-to-other-users-

  • @bourbe
    @bourbe ปีที่แล้ว

    Hello excellent ! I have a question please, let's Say I want to send m'y file with my code to someone who doesn't have python install in his PC, all the calculation in my excel file with my code will work in his PC ?

    • @python-excel
      @python-excel  ปีที่แล้ว

      Hi, thanks for your question! Yes your end user will need to have the PyXLL add-in set up, but that is not hard and can be scripted for them. This link explains more, or contact us via the PyXLL website if you need help with this support.pyxll.com/hc/en-gb/articles/360036822293-How-can-I-distribute-my-PyXLL-functions-to-other-users-

  • @onehumanwasted4228
    @onehumanwasted4228 3 ปีที่แล้ว

    Do you need to have PyXLL installed to just run a python macro?

    • @python-excel
      @python-excel  3 ปีที่แล้ว +1

      Yes, you will need to have the PyXLL add-in installed in order to run any Python code in Excel, including macros.

  • @sakuranooka
    @sakuranooka 3 ปีที่แล้ว

    Does this also work on Mac OS?

  • @Rizwan1875
    @Rizwan1875 3 ปีที่แล้ว

    Why should I do this in python if I can do it easily in vba? I didn't get the answer of this question...

  • @luisk5353
    @luisk5353 3 ปีที่แล้ว +1

    Thank You, Sir!

  • @tangsh497
    @tangsh497 2 ปีที่แล้ว

    If you think VBA is not enough for you, just try VBA+COM, you can code a COM with any programming language such as VB.NET,C, and then VBA could invoke COM,Python also is excellent,but it cant replace VBA,VBA is more easier for office

  • @37no37
    @37no37 3 ปีที่แล้ว +3

    Sorry but VBA is superior, the way you explained it is so easy to understand how difficult is python, VBA IS SUPERIOR AND BETTER AND EASY.

  • @ronarts496
    @ronarts496 3 ปีที่แล้ว

    Does anyone know if a similar thing is available for PowerPoint?

  • @pa6552
    @pa6552 3 ปีที่แล้ว

    Assuming this only works on Windows and not on Linux/MacOS?

  • @khainguyen8082
    @khainguyen8082 3 ปีที่แล้ว +2

    Why complicate something so simple? Learn VBA if you don’t know it.

  • @IBITZEE
    @IBITZEE 3 ปีที่แล้ว

    Excelent video... explicit "qb" in the right dosage...
    ?are there any other languages that work with Excel... and with Jupyter notebooks... (Javascript, C#-Script, ???)

    • @davescott7680
      @davescott7680 3 ปีที่แล้ว

      C#, VB.NET and I think C++. Can all write Add-ins, Google VSTO addins for guides on how.
      JavaScript and any other web language can also be used, Microsoft have simply confusingly decided to call these simply 'Add-ins', they require web hosting and online, and appear as panes on right side of excel.

  • @tivan8040
    @tivan8040 3 ปีที่แล้ว

    Any chance to get this in R?

  • @potorrero
    @potorrero 3 ปีที่แล้ว

    I have a complex excel workbook with many macros that updates lots of cells. Everytime I run one of these macros, it takes a lot of time to finish. Is pyxll faster than vba in such scenario? Also, if I send a pyxll enabled workbook to someone, the person would have to install pyxll also? Or it goes embedded in the file? Thank you.

    • @python-excel
      @python-excel  3 ปีที่แล้ว

      Hi! It depends on what is slow about your current code, but Python can be much faster than VBA in some situations, especially with numerical calculations using numpy or pandas. Other users would also need PyXLL in order to call your functions, though any calculated values would be saved in the workbook (see support.pyxll.com/hc/en-gb/articles/360036822293-How-can-I-distribute-my-PyXLL-functions-to-other-users-)

    • @houstonvanhoy2198
      @houstonvanhoy2198 3 ปีที่แล้ว

      Porterero: I am going to guess that you need need to turn off auto-calculate near the beginning of your VBA module(s), and then turn it back on at the very end of the macro. That might give you better speed. Good luck.

  • @flrazvan
    @flrazvan 3 ปีที่แล้ว +1

    So in order to create a macro by using pyxll you need to install python environment and pyxll to each user that will use this macro? I am not an engineer in programing just using macros and just curious about automation solutions. Why am i asking: solutions are usually for other employees and users which have 0 knowledge of vba/or any other programing language. thanks!

    • @python-excel
      @python-excel  3 ปีที่แล้ว

      Hi Florescu! PyXLL is ideally suited to this sort of scenario and is how many companies use PyXLL. There are various ways to distribute PyXLL, Python and all of your code to the end user, including bundling everything up into a single installer (MSI). Please see www.pyxll.com/docs/userguide/distribution.html for more details or contact us if you need help with anything.

  • @manoharsagunthalla9215
    @manoharsagunthalla9215 3 ปีที่แล้ว

    Your font is so small it not visible too please make font little bigger . Is it possible to do with Windows 7 ?

  • @deal2live
    @deal2live 3 ปีที่แล้ว

    Does this work on macOS?

  • @karthikmngowda
    @karthikmngowda ปีที่แล้ว

    Is it possible to write python code in vba?

    • @python-excel
      @python-excel  ปีที่แล้ว

      You can write Excel macros in Python, which can then be called from VBA using the "Run" method. It's common to do this when migrating a large code base from VBA to Python as you can re-write just some parts in Python rather than having to do everything at once. This page explains more www.pyxll.com/docs/userguide/macros.html.

  • @DonAndress
    @DonAndress 3 ปีที่แล้ว +2

    So exactly what is the advantage of using Python instead of VBA? Judging just by this video i can't see any. It's not even comfortable. It's like you do it because you can. I thought coding was supposed to be as easy as possible. Python in this case is not.

  • @josenildoalmeida8799
    @josenildoalmeida8799 3 ปีที่แล้ว

    Muito bom! Obrigado por compartilhar!!

  • @Dara-lj8rk
    @Dara-lj8rk 3 ปีที่แล้ว

    Does this work if the excel file is sent to someone else who does not have pyxll addin installed?

    • @python-excel
      @python-excel  3 ปีที่แล้ว +1

      Any functions will need your Python code to be able to run, and so will also need the PyXLL add-in installed. If the person you are sending the file to doesn't need to recalculate anything just view the results then they don't need anything. Check out support.pyxll.com/hc/en-gb/articles/360036822253-I-want-to-share-my-work-with-others-Do-they-need-PyXLL-and-Python- for more information about this.

  • @pearsonyam8676
    @pearsonyam8676 3 ปีที่แล้ว

    I can't see anything you're typing in the cmd/terminal..

  • @theminertom11551
    @theminertom11551 3 ปีที่แล้ว

    I use excel in windows but python (and others) in Ubuntu. I see in the video you posted that Excel appears to be running in linux. How is this possible?

  • @alecouto
    @alecouto 3 ปีที่แล้ว

    This is beautiful...

  • @r.a.8618
    @r.a.8618 3 ปีที่แล้ว

    If I'm going to share the Excel file with other users, then obviously I need to have Pyxll add-ins installed in all their PCs as well. Don't see why I should do that.

  • @rerhart585
    @rerhart585 3 ปีที่แล้ว

    The problem with this paradigm is that it will limit you to a the Single Apartment Threading limitation to the Excel Com Object

    • @python-excel
      @python-excel  3 ปีที่แล้ว

      With PyXLL you can write multi-threaded Excel add-ins, including UDFs that run in parallel. Please see support.pyxll.com/hc/en-gb/articles/360037298034-Can-Excel-call-Python-functions-in-parallel- for details.

  • @pay_
    @pay_ 3 ปีที่แล้ว +1

    Subscriptions... the pest of modern days. Otherwise looks like a nice feature

  • @sausagesmcgee7079
    @sausagesmcgee7079 3 ปีที่แล้ว

    I prefer ExcelDNA and using C# to write custom addins - it's the dogs nuts

  • @peterxxl1244
    @peterxxl1244 3 ปีที่แล้ว +1

    I don't understand at all why one should replace VBA (already integrated development environment) with Python. It's not more performant, and it's not easier either. To compare the two, one should not take the Excel macros recorded with the macro recorder, but simple VBA code.
    You can colour an entire area like "A1:C6" with a simple line and don't need all the Python overhead:
    Range("A1:C6").Interior.ColorIndex = 4.
    Or a sentence like: "VBA in Excel! Python unnecessary.", word for word divided into cells:
    For Each wrd In Split("VBA in Excel! Python unnecessary.", " ")
    Cells(i + 1, 1).Value = CStr(wrd): i = i + 1
    Next wrd
    ...can also be written in 3 sentences. So what is the point of Python?

    • @navjotsingh2251
      @navjotsingh2251 3 ปีที่แล้ว

      The idea I can see is easy integration with the many open source packages in python, like pandas scikit learn tensor flow etc.

    • @peterxxl1244
      @peterxxl1244 3 ปีที่แล้ว

      @@navjotsingh2251 I am aware that there are many possibilities. Applications such as Excel can be controlled with many other languages: Powershell, Java/Groovy, JavaScript, C# etc. etc. etc. And that is by accessing the object model of Excel. Another question is whether it makes sense to use a different language than the VBA already installed with Excel. The article promises that it is possible to replace VBA "completely" with Python, which in my eyes would be neither correct nor sensible.

  • @CasparusBadenhorst
    @CasparusBadenhorst 3 ปีที่แล้ว

    Nice. will Phython work for Excel 365?

    • @PhilHibbs
      @PhilHibbs 3 ปีที่แล้ว

      As I understand it Excel 365 can't do VBA macros, so I'd expect not.

  • @user-fx2ku5hh7i
    @user-fx2ku5hh7i 3 ปีที่แล้ว

    Даёт ошибку в строке "xl = Dispatch('Excel.Application')". Возможно, из-за старой версии Excel (i have v2007)
    I am not a programmer, but i need to run the macros.

    • @user-kk4ku1jh3i
      @user-kk4ku1jh3i 3 ปีที่แล้ว

      import win32com
      from win32com.client import constants
      #xl=Dispatch("Excel.Application")
      # вместо Dispatch лучше вызывать EnsureDispatch
      xl = win32com.client.gencache.EnsureDispatch('Excel.Application')

  • @henrikijonkoping4694
    @henrikijonkoping4694 3 ปีที่แล้ว

    Are there any other programming software that works like VBA? Anybody who knows?

  • @billmckinzie
    @billmckinzie 3 ปีที่แล้ว

    Is Python faster?

  • @cryptomugen1315
    @cryptomugen1315 3 ปีที่แล้ว

    thank you for this antastic tutorial! hope you can create a similar tutorial with a real use case. e.g. a function that can scrape data from a web page and then append to existing data in am Excel file.