r/MSAccess • • 1d ago

[UNSOLVED] Replacing the default IDE vba editor with VS code

Hello everyone is there anyway to replace the default VBA Editor with VS Code? While running my code normally while using Access or Excel? The codes are saved in my Excel/Access file as normal but I only can interact with the code from VS code? If the answer is yes how can I do it? And the most important question if I did do it what are the benifits I can expect from doing such a thing ?

2 Upvotes

16 comments sorted by

•

u/AutoModerator 1d ago

IF YOU GET A SOLUTION, PLEASE REPLY TO THE COMMENT CONTAINING THE SOLUTION WITH 'SOLUTION VERIFIED'

  • Please be sure that your post includes all relevant information needed in order to understand your problem and what you’re trying to accomplish.
  • Please include sample code, data, and/or screen shots as appropriate. To adjust your post, please click Edit.
  • Once your problem is solved, reply to the answer or answers with the text “Solution Verified” in your text to close the thread and to award the person or persons who helped you with a point. Note that it must be a direct reply to the post or posts that contained the solution. (See Rule 3 for more information.)
  • Please review all the rules and adjust your post accordingly, if necessary. (The rules are on the right in the browser app. In the mobile app, click “More” under the forum description at the top.) Note that each rule has a dropdown to the right of it that gives you more complete information about that rule.

Full set of rules can be found here, as well as in the user interface.

Below is a copy of the original post, in case the post gets deleted or removed.

User: brosama1420

Replacing the default IDE vba editor with VS code

Hello everyone is there anyway to replace the default VBA Editor with VS Code? While running my code normally while using Access or Excel? The codes are saved in my Excel/Access file as normal but I only can interact with the code from VS code? If the answer is yes how can I do it? And the most important question if I did do it what are the benifits I can expect from doing such a thing ?

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Jealy 90 1d ago

Lol I wanted this too so I had Claude build me a VSCode addin.

It started just as a formatter, but ended with full editing.

1

u/brosama1420 1d ago

How is your experience so far? Is it easy to do? I am not used to programming aside from office automation and db design in access

1

u/MultiUserDungeonDev 23h ago

Check out:

https://marketplace.visualstudio.com/items?itemName=WilliamSmithE.xlide

and

https://github.com/WilliamSmithEdward/pyOpenVBA

They both read and write VBA directly to the MS Access DB, without even needing Office 365 apps installed (runs on Mac / Linux / CI etc).

2

u/George_Hepworth 5 1d ago

No. There is not.

However, there are at least two efforts at creating third party VBA-like applications. One is called TwinBasic.https://twinbasic.com/ Another is called, I think, RadBasic. https://www.radbasic.dev/

To be honest, it's hard to speculate what benefits you might get. What problems are you actually trying to overcome by considering an alternative.

2

u/MultiUserDungeonDev 23h ago

Hey George,

I actually do have a full featured VS Code extension that works 100% compatible with MS Access files. It was launched this year.

https://marketplace.visualstudio.com/items?itemName=WilliamSmithE.xlide

It reads and writes VBA directly to the Access database using open source algorithms I developed. You don't even need to be on Windows or have office 365 apps installed.

2

u/George_Hepworth 5 20h ago

Thanks. An external editor. I assume you have to export/import the modules to edit them that way, correct? I had interpreted the original question as looking for an internal replacement for the VBA IDE, but that's obviously not the only way to accomplish the goal. I appreciate the correction.

1

u/MultiUserDungeonDev 19h ago

Nope, it edits the VBA directly in the file.

There is also an internal editor that’s a sister project to the external editor:  https://github.com/WilliamSmithEdward/xlide_vbide

2

u/George_Hepworth 5 19h ago

Nice. I'll look into it.

2

u/saketaco 1 1d ago

You can use a version control add-in to export your project to source code then use VS Code to develop it. When complete you rebuild your project from the edited source code using the same add-in.. https://github.com/joyfullservice/msaccess-vcs-addin

1

u/MultiUserDungeonDev 23h ago

Hey, hope you are doing well today!

That's a great question. I have a free / open source VS Code extension (totally free forever, no strings attached) for exactly this use case.

It reads/writes directly to your VBA office files using open source algorithms that I developed for interfacing with office files. It works with most Excel, Word, Power Point and Access files.

Benefits are numerous including live analysis of your code (tells you if something is not correct and how to fix it), completions (recommendations as you type of all the available code you may want to implement), direct and simple AI agent integration, version control with Git, unit testing, and a lot more.

Check it out, and let me know if I can help in any way:

https://marketplace.visualstudio.com/items?itemName=WilliamSmithE.xlide

1

u/Mindflux 31 22h ago

Question: Can you have the accdb open in MS Access for re-running code (albeit the form, module or whatever closed) while modifying in XLIDE? Save back and then test the changes without some open/close MS Access to see modifications type pattern?

1

u/MultiUserDungeonDev 22h ago

Not while it's open, no. Access locks the accdb, and XLIDE writes the file directly, so a save can't land until Access lets go.

XLIDE can do the close and reopen for you. Open the database from XLIDE with Ctrl+Alt+O and set xlide.officeIntegration.coordinationMode to closeTracked. Each save then closes the database in Access, writes it, and reopens it.

F5 on a procedure saves, reopens the database and runs it in Access. F5 on a form opens the form (windows only).

I have a sister project to the VS Code extension which installs a similar editor surface directly into the VBA IDE, and works directly without needing to reopen: https://github.com/WilliamSmithEdward/xlide_vbide

1

u/Mindflux 31 22h ago

I saw the sister product, but even though the VBIDE works for Excel, Access, Powerpoint, etc the github page seems to specifically target Excel in the wording. Perhaps I'll try this, I did try the XLIDE for vscode on an empty database at home just to try and really all I noted is that the autocomplete is incomplete (it didn't know what dlookup was).

I realize it's in beta so I can't fault it, just an observation.

1

u/MultiUserDungeonDev 22h ago

Fair enough, and a good call out. Excel is definitely my bread and butter these days, so it was the app I spent the most time testing with.

More than happy to take any bug reports or feature requests here or on GitHub (preferred). I want to make this the best developer experience for Access as possible. I love Access too and it's been a boon to me professionally.

Both apps are fully launched at this point, but of course neither is perfect.

1

u/MultiUserDungeonDev 22h ago

issue opened to investigate, and will roll fix findings into next patch: https://github.com/WilliamSmithEdward/xlide_vscode/issues/1735