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!
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.
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.
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.
@@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?
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.
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
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?
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!
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
@@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.
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.
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.
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?
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?
@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 ... 😉
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?
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.
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 :(
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?
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.
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)
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.
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 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 ?
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!
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
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.
@@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?
@@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
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.
I like many others feel the pain of using the VBA editor.. Incredible work!!
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!
honestly needed this. VBA within Excel has really done a number on my eyes this past week
I can’t believe Microsoft hasn’t implemented this internally by now
Too complicated for them? ;-)
I sometimes think they don't care about VBA devs
@@heathergray4880 they don’t
MS is planning on Replacing VBA with Office Scrips
Definitely useful. Also, I just learnt a lot of new tricks on VS Code.
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.
Been using my own solution for two years because the VBE is so bad, this is amazing! Thanks!
True heroes don't wear cape. This is great!
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.
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.
@@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?
That is just Great was looking for such a tool for years
Omg i love it. I missed the tabbing in VB so much.
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.
WoooooooooooW...What a fantastic job you have done!
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.
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
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?
It’s amazing, it makes coding VBA less painful!
My compliments. Fantastic and very useful work!
Is this only for MS Excel, or will this also work with MS Word projects as well?
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!
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
@@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.
E pra auto completar já é outra extensão
@@KaueS.Hoffmann-Ethos caramba é só isso? Vou tentar...
Acabei achando outro vídeo que fala da extensão *xvba* essa faz o auto preenchimento
@@KaueS.Hoffmann-Ethos esse seu problema talvez se resolva configurando o teclado para o padrão americano
Wow, your tutorial is amazing... Can you show if something similar is available for Libreoffice Calc..?
xlwings vba edit
xlwings version: 0.27.7
This command is currently only supported on Windows. 😥
This method is suitable for MS Access too?
Does this work for MS Access too?
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.
You have to go into Excel Options->Trust Center->Enable Trust Center-> Macro Settings -> enable "Trust access to the VBA project object model"
how to support word vba editor?
Excellent feature! Danke schoen Felix! 👍
This is great. The VBA editor is so limited.
Great feature. I will love that for sure
Thanks very useful. Now we just need a LSP from Microsoft for VBA.
That’s incredible.. is there already a standalone version? Thanks for your work!
Yes there has been since a while: github.com/xlwings/xlwings/releases
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.
You’re not linking anything, the code is imported into the normal VBA editor, so no difference to normal workbooks.
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?
Seconding this - a small json configuration file or something would do the trick.
Anyway amazingly helpful! @xlwings
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.
I get this annoying error when I try to run this "xlwings vba edit":
Is there any solution for that ?
ANyone got this to work?
is there a way of working with multiple workbooks?
This extension was deprecated recently
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?
Amazing! Thank you!
I love you, thank you
It's a pain to work with the Excel vba editor
@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 ... 😉
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.
IT SAVES HAIR ON MY HEAD. THANK YOU
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?
but how to debug with vba in vs code ide? thanks
Good work, but Seems it should starts with installation steps, starting point missing.
All vba user are not friendly with 'packages' stuffs
Hi!!, great video, but I can´t download the extension, it says "This extension is deprecated" :'( any suggestions? thanks in advance
Thanks, I would like to know if is possible to debug vba code with xlwings into VS Code?
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.
I think the Extension 'VSCode VBA' is deprecated use the one just called 'VBA' instead. This worked on my machine\.
I cant install it. It says "This extension is deprecated. Use the VBA extension instead."
Hi, me too, you solve the problem??
Am I able to get this functionality without XL Wings entire add-in?
Thansk man! pretty nice
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 :(
you can download an xlwings.exe from the Github release page nowadays, see the newer video about Copilot
it works, perfectly thank u
Very nice - put a show stopper, that danish æøå are messed up when the code returns to Excel VBA
This may be connected to: github.com/xlwings/xlwings/pull/2380
这个扩展支持pycharm吗 还是必须vs?
amazing! can it support modules folder structure?
there is a vscode extension called [XVBA] can support folder structure, but can not support ctrl+s auto-sync
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?
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.
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)
Amazing! Can this works with .dvb (AutoCAD VBA) projects?
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.
Thanks. I really hope MS someday look for those still using VBA. It is so great product.
can someone help me with the installation??
How to add a module? We must create in VBA?
Yes, adding a module needs to be done in the VBA editor.
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!
Open the Anaconda Prompt and run: conda upgrade xlwings
@@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 ?
@@klausR3854 Same here, can't get the newest version running that command. Have you found a solution since then? @xlwings
@@klausR3854 Answering myself: pip install --upgrade xlwings. That did the job
Can we debug the vba codes into VS editior?
Unfortunately, for debugging, you’ll still need the VBA editor :-/
very cool, thanks!
It was only ever about Dark Mode
i love you!
Amazing, is it possible to do this for password protected addins?
Yes, but you’ll have to unlock the VBA project manually before running the “xlwings vba edit” command
@@xlwings9689 Thanks for confirming!
will this work with access
No. But it’s open source and you may take it as a starting point for PPT
Brilliant, thanks!
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!
Any solution for ms Word?
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
Thank you.
incredible
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.
I get an error when running "xlwings vba edit"
"'xlwings' is not recognized as an internal or external command,
operable program or batch file."
Sorry for the late answer: this currently requires Python with xlwings installed: docs.xlwings.org/en/stable/installation.html
@@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?
@@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
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.
It works for me. You might have some peculiarities you need to work through. What errors are you getting? Maybe I can help?
does this work with microsoft word as well?
I'd like to know too.