Edit your Excel VBA with VS Code (with auto-sync)

Поделиться
HTML-код
  • Опубликовано: 4 дек 2024

Комментарии • 117

  • @vhphan19
    @vhphan19 2 года назад +44

    I like many others feel the pain of using the VBA editor.. Incredible work!!

  • @andrew_hubbard
    @andrew_hubbard Год назад +1

    Thanks for this. I've just found your video. I'm back to VBA coding after a 14 year break from it. It's so nice to be able to work in VS Code in dark mode. My eyes are feeling much better!

  • @Based-Pharaoh
    @Based-Pharaoh Год назад

    honestly needed this. VBA within Excel has really done a number on my eyes this past week

  • @richardwelsh7901
    @richardwelsh7901 2 года назад +21

    I can’t believe Microsoft hasn’t implemented this internally by now

    • @renzopeduzzi754
      @renzopeduzzi754 2 года назад +2

      Too complicated for them? ;-)

    • @heathergray4880
      @heathergray4880 2 года назад +5

      I sometimes think they don't care about VBA devs

    • @MaribelAgudelo
      @MaribelAgudelo 2 года назад +5

      @@heathergray4880 they don’t
      MS is planning on Replacing VBA with Office Scrips

  • @domenicoieracitano2138
    @domenicoieracitano2138 Месяц назад

    Definitely useful. Also, I just learnt a lot of new tricks on VS Code.

  • @edmel144
    @edmel144 9 месяцев назад

    4:02 You can comment out multiple lines in the VBA IDE by attaching an accelerator key C to the comment quick action, and U to the uncomment quick actions.

  • @clintonk7357
    @clintonk7357 Год назад

    Been using my own solution for two years because the VBE is so bad, this is amazing! Thanks!

  • @keysersoze4330
    @keysersoze4330 Год назад

    True heroes don't wear cape. This is great!

  • @Sancarn
    @Sancarn 2 года назад +6

    At this point you might as well use stdVBA project builder. The big problems come in with compile errors, debugging. You will get loads of stuff wrong with coding in an external editor. I also feel like this shouldn't be an exe or part of some binary addin, but be a excel addin (made in vba). Reason being, that many people don't have the ability to e.g. run python, or exes.

    • @aseetpatel21
      @aseetpatel21 3 месяца назад

      Can you elaborate about what you mean? In another comment, the reply was that business users can just use the Excel file without needing to install or download anything else.

    • @Sancarn
      @Sancarn 3 месяца назад

      @@aseetpatel21 stdVBA - a project on github maintained by myself - has a project builder, which uses the VBE API to import all modules in a neighbouring src file into itself. This was made for testing purposes. Is this what you meant?

  • @laurentgaume125
    @laurentgaume125 Год назад

    That is just Great was looking for such a tool for years

  • @Saftiges_Brot
    @Saftiges_Brot 4 месяца назад

    Omg i love it. I missed the tabbing in VB so much.

  • @alcidesneto6415
    @alcidesneto6415 Год назад

    Amazing work!! Finally, I can use VBA at my work! I wouldn't say I like the VBE; because of it, I always stay far away from VBA.

  • @mannarmani6420
    @mannarmani6420 Год назад +1

    WoooooooooooW...What a fantastic job you have done!

  • @aristh
    @aristh 2 года назад +4

    Is there any way to make the Visual Studio Code aware of the other modules? For example if we have multiple modules, how could we link or access the other functions in VSCode that doesn't involve to open the files? This is useful if we want to call functions in other modules, but VSCode doesn't recognize them as they are not imported.

  • @MrKameramannen
    @MrKameramannen Год назад

    A very handy way to get vba-code under git-control! That is the most important for me. Thanks! As an alternative editor it's less interesting as intelisense and debugging isn't there

  • @user-leesj
    @user-leesj 2 года назад +3

    I’ve installed xlwings into my Macbook and the CLI says it only supports Windows for now; do you have any plans for adding Mac support of this feature?

  • @luizporto1525
    @luizporto1525 2 года назад

    It’s amazing, it makes coding VBA less painful!

  • @SanteFrezza
    @SanteFrezza Год назад

    My compliments. Fantastic and very useful work!

  • @JeremyKolassa
    @JeremyKolassa 2 года назад +3

    Is this only for MS Excel, or will this also work with MS Word projects as well?

  • @KaueS.Hoffmann-Ethos
    @KaueS.Hoffmann-Ethos 3 месяца назад +1

    Xlwings is soo good, I just wish that when you edit some code fron vba, it recives correctily that characters such as ç or á, for a brazilian like me, it would be perfect. thanks XLwings for making my life a litle easier!

    • @MCAES01
      @MCAES01 2 месяца назад

      Você entendeu como faz? Eu não sou desenvolvedor. Sou um hobista de vba. Mas sinto falta da sugestão dos códigos quando se começa a digitar, que tem em outros programas e não tem no vba genuíno

    • @KaueS.Hoffmann-Ethos
      @KaueS.Hoffmann-Ethos 2 месяца назад +1

      @@MCAES01 Cara, funcionou sim, o único problema que eu tive foram as letras como "ã" e "ç" viram "??". depois de baixar a extensão, vc abre o excel normalmente e digita no terminal do vscode "xlwings vba edit", isso vai procurar o excel aberto e te perguntar se quer edita-lo, digite y e seja feliz kk.

    • @KaueS.Hoffmann-Ethos
      @KaueS.Hoffmann-Ethos 2 месяца назад

      E pra auto completar já é outra extensão

    • @MCAES01
      @MCAES01 2 месяца назад

      @@KaueS.Hoffmann-Ethos caramba é só isso? Vou tentar...
      Acabei achando outro vídeo que fala da extensão *xvba* essa faz o auto preenchimento

    • @MCAES01
      @MCAES01 2 месяца назад

      @@KaueS.Hoffmann-Ethos esse seu problema talvez se resolva configurando o teclado para o padrão americano

  • @kapilvora
    @kapilvora 3 месяца назад

    Wow, your tutorial is amazing... Can you show if something similar is available for Libreoffice Calc..?

  • @olivierwouters9426
    @olivierwouters9426 2 года назад +2

    xlwings vba edit
    xlwings version: 0.27.7
    This command is currently only supported on Windows. 😥

  • @santiagootalvaro6473
    @santiagootalvaro6473 Год назад +1

    This method is suitable for MS Access too?

  • @interestingamerican3100
    @interestingamerican3100 Год назад +2

    Does this work for MS Access too?

  • @MattLGreer
    @MattLGreer 2 года назад +3

    Named everything 'demo' as you did. Put it in a folder called 'demo' on my desktop as you did. Opened the xlsm and py files, opened a terminal window, ran the command as you did. I made sure that I changed directories to the folder with the .py flie and the .xlsm file in the terminal. Made sure that the folder and all subfolders were trusted. I got the following error: 'Programmatic access to Visual Basic Project is not trusted'
    Where can someone get help with xlwings? The reddit forum is completely dead.

    • @gamagetf
      @gamagetf Год назад +2

      You have to go into Excel Options->Trust Center->Enable Trust Center-> Macro Settings -> enable "Trust access to the VBA project object model"

  • @gangbingo
    @gangbingo 2 года назад +1

    how to support word vba editor?

  • @aurelnicolae6714
    @aurelnicolae6714 2 года назад

    Excellent feature! Danke schoen Felix! 👍

  • @slinden
    @slinden Год назад +1

    This is great. The VBA editor is so limited.

  • @renzopeduzzi754
    @renzopeduzzi754 2 года назад

    Great feature. I will love that for sure

  • @musefirefox2420
    @musefirefox2420 2 года назад +1

    Thanks very useful. Now we just need a LSP from Microsoft for VBA.

  • @TH-rh4dn
    @TH-rh4dn 5 месяцев назад

    That’s incredible.. is there already a standalone version? Thanks for your work!

    • @xlwings9689
      @xlwings9689  5 месяцев назад

      Yes there has been since a while: github.com/xlwings/xlwings/releases

  • @raysrule81
    @raysrule81 Год назад +1

    hey this is great! But I am wondering, if I link Visual Studio to my Excel file's VBA, whenever I send this Excel file to others, do they also need to install these extensions to be able to use the code in the worksheet? Or can they still use it as normal without having to have Visual Studio or anything else installed? Most of my coworkers that I will be sending these files to will mostly only be using the macro within them and not messing with the code. But I just want to make sure that it will still work for them no problem.

    • @xlwings9689
      @xlwings9689  Год назад +4

      You’re not linking anything, the code is imported into the normal VBA editor, so no difference to normal workbooks.

  • @rstiekema
    @rstiekema 2 года назад +1

    You are my hero! Really thanks for building this. Could you please tell me if its possible to have all the files exported in a subfolder? The file explorer gets kinda messy with all the files in the root directory. Also, I would love it if it would clean up the files after done editing. Maybe there is already a command for that?

    • @MarkusLuisser
      @MarkusLuisser Год назад +1

      Seconding this - a small json configuration file or something would do the trick.
      Anyway amazingly helpful! @xlwings

  • @jordanovalle633
    @jordanovalle633 Год назад

    I cant do it, can you help me? please! error is:
    "xlwings" no se reconoce como un comando interno o externo,
    programa o archivo por lotes ejecutable.

  • @oktamiav
    @oktamiav 2 года назад +2

    I get this annoying error when I try to run this "xlwings vba edit":
    Is there any solution for that ?

    • @liying1282
      @liying1282 Год назад

      ANyone got this to work?

  • @YovaniAchataFlores
    @YovaniAchataFlores 10 месяцев назад

    is there a way of working with multiple workbooks?

  • @raphaelbonillo2192
    @raphaelbonillo2192 2 года назад +1

    This extension was deprecated recently

  • @legiaoanimes3074
    @legiaoanimes3074 11 месяцев назад

    olá. eu quero somente rodar o vba escrito no vscode no excel, nao quero fazer alteracoes mais afundo, so isso mesmo...
    é necessario todos estes arquivos? pq como uso muito vba, vai ser um grande volume de arquivos se forem tantos arquivos para cada projeto vba...
    tem como usar so 1 arquivo? como faço?

  • @milionowski
    @milionowski 2 месяца назад

    Amazing! Thank you!

  • @HelPfeffer
    @HelPfeffer 2 года назад

    I love you, thank you
    It's a pain to work with the Excel vba editor

  • @Damoskt
    @Damoskt 2 года назад

    @xlwings
    It's really the best! Thank you for this development.
    The must to be able to launch the debugging from Visual Studio...
    Thank you to let me know the day we can do it ... 😉

    • @edmel144
      @edmel144 9 месяцев назад

      I was wondering this too. There is another package on VS Code extension that can do this XVBA, but I could not get the whole thing to work properly.

  • @kabukijoe99
    @kabukijoe99 Год назад

    IT SAVES HAIR ON MY HEAD. THANK YOU

  • @Huizar
    @Huizar Год назад

    Hi - Great work. Whenever I try to Save, the code does not update automatically on the VBA project, I have to run the xlwings vba import command. Is there a setting that I need to change? if so - wuere is it?

  • @joong1128
    @joong1128 9 месяцев назад

    but how to debug with vba in vs code ide? thanks

  • @NabranAboubacar
    @NabranAboubacar Месяц назад

    Good work, but Seems it should starts with installation steps, starting point missing.
    All vba user are not friendly with 'packages' stuffs

  • @jgarale
    @jgarale Год назад

    Hi!!, great video, but I can´t download the extension, it says "This extension is deprecated" :'( any suggestions? thanks in advance

  • @arturodeltoro1071
    @arturodeltoro1071 2 года назад

    Thanks, I would like to know if is possible to debug vba code with xlwings into VS Code?

  • @henrycullen950
    @henrycullen950 2 года назад

    Hi @xlwings is the “xlwings vba edit” deprecated now? I couldn’t find the replacement commands in your cli doc. Btw this is an amazing tool. I’m just getting started as a developer but if there any OS projects you want an extra helping hand in I’d love to give back.

    • @edmel144
      @edmel144 9 месяцев назад

      I think the Extension 'VSCode VBA' is deprecated use the one just called 'VBA' instead. This worked on my machine\.

  • @jadeco321
    @jadeco321 2 года назад +1

    I cant install it. It says "This extension is deprecated. Use the VBA extension instead."

    • @jgarale
      @jgarale Год назад

      Hi, me too, you solve the problem??

  • @heathergray4880
    @heathergray4880 2 года назад

    Am I able to get this functionality without XL Wings entire add-in?

  • @christiantilano
    @christiantilano 2 месяца назад

    Thansk man! pretty nice

  • @DanieldeAmilivia
    @DanieldeAmilivia 8 месяцев назад

    I was so excited about this, but something seems off with this module. When running " xlwings vba edit", I get this error: "Please install watchgod to use this functionality", although I already installed it :(

    • @xlwings9689
      @xlwings9689  8 месяцев назад

      you can download an xlwings.exe from the Github release page nowadays, see the newer video about Copilot

  • @patriciohernandezballester2485
    @patriciohernandezballester2485 2 года назад

    it works, perfectly thank u

  • @Henrik.Vestergaard
    @Henrik.Vestergaard 7 месяцев назад

    Very nice - put a show stopper, that danish æøå are messed up when the code returns to Excel VBA

    • @xlwings9689
      @xlwings9689  7 месяцев назад

      This may be connected to: github.com/xlwings/xlwings/pull/2380

  • @donglong5597
    @donglong5597 Год назад

    这个扩展支持pycharm吗 还是必须vs?

  • @stevechow8892
    @stevechow8892 2 года назад

    amazing! can it support modules folder structure?

    • @stevechow8892
      @stevechow8892 2 года назад

      there is a vscode extension called [XVBA] can support folder structure, but can not support ctrl+s auto-sync

  • @groomaaron06
    @groomaaron06 2 года назад

    Hey Felix,
    Is there a way to two-way bind the changes between the VBA editor and the Custom text editor? I find that changes made in the custom editor are uploaded to the VBA editor instantaneously (AMAZING), but I don't seem to be able to make changes in the VBA editor and have these reflect back in the custom editor? Am I missing something?

    • @felixzumstein1302
      @felixzumstein1302 2 года назад +1

      Hi Aaron! Yeah, it's a one-way-road at the moment, and I don't really know if it would be possible to make a bidirectional syncing without getting caught in an circular loop ;) The only thing that xlwings supports today is to stop the syncing, then run "xlwings vba export", which will overwrite your local files with those from Excel.

  • @NewYears1978
    @NewYears1978 2 года назад

    Got excited, then it said Python..don't know anything about Python..
    Would be nice if installing Python or one of the packackes and then what to there would be in this video. I could not continue since once I installed Anaconda, I did not know what to do.
    Better yet a full step by step, this guide was super confusing..none of the steps are explain. I installed Anaconda but xlwings doesn't work in the VS Terminal..(works in Anaconda command line itself)

  • @borgesfernandoaugusto
    @borgesfernandoaugusto 2 года назад

    Amazing! Can this works with .dvb (AutoCAD VBA) projects?

    • @felixzumstein1302
      @felixzumstein1302 2 года назад +1

      Hi Fernando, unfortunately, I am not familiar with AutoCAD... but if AutoCAD exposes a COM interface with methods to manipulate the VBA code, it would be possible to come up with something similar via pywin32 or any other programming language that is able to program COM.

    • @borgesfernandoaugusto
      @borgesfernandoaugusto 2 года назад

      Thanks. I really hope MS someday look for those still using VBA. It is so great product.

  • @adonisserranofigueroa9158
    @adonisserranofigueroa9158 2 года назад

    can someone help me with the installation??

  • @danieldresto7372
    @danieldresto7372 2 года назад

    How to add a module? We must create in VBA?

    • @felixzumstein1302
      @felixzumstein1302 2 года назад

      Yes, adding a module needs to be done in the VBA editor.

  • @笹井将行
    @笹井将行 2 года назад

    I am trying to set up as this Video, then installed Anaconda. Sadly, anaconda environment's xlwings version is 0.24.9. This command seems work later than 0.26.3 or equal.
    How could I update anaconda xlwings package later than 0.26.3??
    I really want to use this Auto-sync between VS code and VBA!

    • @xlwings9689
      @xlwings9689  2 года назад +2

      Open the Anaconda Prompt and run: conda upgrade xlwings

    • @klausR3854
      @klausR3854 2 года назад

      @@xlwings9689 That doesn't work. After running conda upgrade xlwings in the Anaconda prompt I still have xlwings version 0.24.9. How can I get version >= 0.26.3 ?

    • @guillermoleonrodriguez7858
      @guillermoleonrodriguez7858 2 года назад

      @@klausR3854 Same here, can't get the newest version running that command. Have you found a solution since then? @xlwings

    • @guillermoleonrodriguez7858
      @guillermoleonrodriguez7858 2 года назад +1

      @@klausR3854 Answering myself: pip install --upgrade xlwings. That did the job

  • @praveenkumawat2662
    @praveenkumawat2662 2 года назад

    Can we debug the vba codes into VS editior?

    • @xlwings9689
      @xlwings9689  2 года назад

      Unfortunately, for debugging, you’ll still need the VBA editor :-/

  • @anastasioualex
    @anastasioualex 2 года назад

    very cool, thanks!

  • @edmel144
    @edmel144 9 месяцев назад

    It was only ever about Dark Mode

  • @deathtomasz
    @deathtomasz 2 года назад

    i love you!

  • @groomaaron06
    @groomaaron06 2 года назад

    Amazing, is it possible to do this for password protected addins?

    • @xlwings9689
      @xlwings9689  2 года назад +1

      Yes, but you’ll have to unlock the VBA project manually before running the “xlwings vba edit” command

    • @groomaaron06
      @groomaaron06 2 года назад

      @@xlwings9689 Thanks for confirming!

  • @rdwz9649
    @rdwz9649 3 месяца назад

    will this work with access

    • @xlwings9689
      @xlwings9689  3 месяца назад

      No. But it’s open source and you may take it as a starting point for PPT

  • @kabooza
    @kabooza 2 года назад

    Brilliant, thanks!

  • @hongthaitruong2701
    @hongthaitruong2701 2 года назад +1

    How I solved this error
    'xlwings' is not recognized as an internal or external command, operable program or batch file.
    I do not have Anaconda (too heavy). I just installed via “pip install xlwings” and running xlwings on cmd (Window + R -> cmd -> enter) will lead to that error
    Here is how I fixed it, it sounds stupid but it worked =)))
    1. pip uninstall xlwings
    You will see all relevant folders. Try to catch the one ending with “…\scripts\xlwings.exe”
    Copy full path except “xlwings.exe”, then type N to cancel the uninstall
    2. Set path environment variable
    Using cmd: setx PATH "%PATH%;[your path]”
    For example: setx PATH "%PATH%;C:\Python39\...\scripts\”
    3. Restart cmd and retry xlwings
    (Next, you may need this:
    xlwings addin install
    pip install watchgod)
    Good luck!

  • @diaboliq7
    @diaboliq7 2 года назад

    Any solution for ms Word?

    • @xlwings9689
      @xlwings9689  2 года назад

      Not via xlwings, no, but if you're fluent in Python, you could adapt the code to work with a pywin32 object representing Microsoft Word instead of Excel, see here: github.com/xlwings/xlwings/blob/main/xlwings/cli.py#L673

  • @Pankaj-Verma-
    @Pankaj-Verma- 2 года назад

    Thank you.

  • @seungpark2944
    @seungpark2944 Год назад

    incredible

  • @TravisLP27
    @TravisLP27 2 года назад

    I want this so bad but couldn't even figure out how to get started. Why do I have to learn python now I"m not even good with VBA yet, idk how people deal with the frustration of dev work I'm surprised people can even do it at all honestly I must be way dumber than I thought. Guess I'll stick to SQL.

  • @gd6noob
    @gd6noob 2 года назад

    I get an error when running "xlwings vba edit"
    "'xlwings' is not recognized as an internal or external command,
    operable program or batch file."

    • @xlwings9689
      @xlwings9689  2 года назад

      Sorry for the late answer: this currently requires Python with xlwings installed: docs.xlwings.org/en/stable/installation.html

    • @klausR3854
      @klausR3854 2 года назад

      @@xlwings9689 I have the same issue as gd6noob.
      I installed the newest version for Windows 64-bit of Anaconda. When I try to call xlwings in a powershell terminal or in the terminal of VSCode I get the errormessage "xlwings: The term 'xlwings' is not recognized as a name of a cmdlet, function, script file, or executable program.
      Check the spelling of the name, or if a path was included, verify that the path is correct and try again."
      Only when I start "Anaconda Powershell Prompt(anaconda3) in the windows Startmenu and call then xlwings I get no error message. How can I start xlwings in a standard powershell terminal and in the terminal of VSCode?

    • @xlwings9689
      @xlwings9689  2 года назад

      @@klausR3854 The Anaconda Prompt/PS are really just standard Command Prompts/PS with some initialization code, so the easiest is definitely to use them instead of Cmd/PS. You can also try to run "conda init powershell" in PS, but you'll need to double-check where conda.bat or .exe is (in the install directory Anaconda3\Scripts or \bin), see stackoverflow.com/questions/64149680/how-to-activate-conda-environment-from-powershell

  • @tarn46
    @tarn46 Год назад +3

    Installation instructions are rubbish, they do not work. I've followed everything and the latest version of VS Code 1.78.2 does not recognise anything. I would remove this video.

    • @edmel144
      @edmel144 9 месяцев назад

      It works for me. You might have some peculiarities you need to work through. What errors are you getting? Maybe I can help?

  • @nigeldavis
    @nigeldavis 7 месяцев назад

    does this work with microsoft word as well?