I have inherited a lot of VBA code to maintain and so far I am using the VBE. Sometimes is quite hard to do some tasks, like advanced text search, so usually I export the module, edit the content with vim and import the modified module to test the code.

This can get a little messy and boring. I know that VBE can be COM automated, so I was thinking if there is a way (like a plugin or a script) to use an external Text Editor (vim, notepad++ or sublime text) to write VBA code and then refresh it automatically in the VBE

Thanks in advance


AkelPad has VB scripts enabled, so try to ask at Akelpad site about it. Also PSPad has.

  • 1
    I made a script to refresh my project and AkelPad worked just fine. Thank you, @Ingo – kb_sou Feb 14 '13 at 11:49
  • How do I turn syntax highlighting on and choose the syntax language in AkelPad? – Ivan Aug 21 '14 at 13:17
  • @kb_sou Could you share some details about how you refresh the project please? – Scorchio Feb 20 '16 at 11:56

Recently I found Text Edit Anywhere, and using one hotkey I can now get a notepad++ editor window synchronized with the Excel code editor.

The only problem I did not manage to solve so far is that Cyrillic letters fail to pass from notepad++ to Excel: as soon as I save the script once, all they are converted to question marks (although copy-paste from notepad++ preserves the letters). Other than that I'd highly recommend the solution: it allows you to edit text in any program with any editor.

  • 2
    I can't upvote this workaround enough times. – Scorchio Feb 20 '16 at 12:00
  • 1
    Just tried that application because I was tiered (again) of the pretty basic VBE functionality concerning editing text. Combining this application with Sublime Text 3 + VBScript package using PATH\TO\ST3\subl.exe -nw "%1" with vba as extension to set correct file text automatically is a pretty decent solution for the moment. – Felix Bayer Jul 4 '16 at 11:28

Sublime Text 2 can work with VBscript as well. You'll need this VBscript Package (github) to access the syntax.

enter image description here

  • Well, that's just for syntax highlighting... Is there anyway to directly edit it from ST without the need to copy/paste in excel's editor again ? – Enissay Mar 12 '17 at 18:52
  • Export your module as a .bas and then edit it and reimport it – Raystafarian Mar 13 '17 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.