Bring VBA into the modern world
It would have a couple of stages.
Stage 1: Get Visual Studio features into the VBA development environment.
Stage 2: Fully integrate VBA into Visual Studio.
Stage 3: Continually improve VBA until it is a modern langauge.
VBA is probably the most used programming language in the world.
It has so many established users that MS could really get big brownie points by continually improving the experience for users and developers. Why it has stagnated for so long I have never understood.
I want to thank everyone for weighing in – none of us on the Excel team are surprised that this item is getting a lot of votes, and we have read all of the feedback in this thread. Extensibility in Excel is something that we are passionate about, and while we’ve been focused on other investments over the last few years (primarily around getting Excel onto more devices with versions for Mac, iOS, Android, and Windows 10), this is something we’ve been actively discussing as we figure out how to enable extensibility of those new platforms.
As it stands, here’s our current position.
First, VBA is very important to Excel, and we plan to keep it around for the foreseeable future. As we add new features to Windows Desktop and Mac versions of Excel (where VBA is supported), we’ll continue to add object model for those features (see http://dev.office.com/blogs/VBA-improvements-in-Office-2016), so you have programmable access to all of the capabilities of the application. Put even more bluntly: we know VBA is awesome, and we’re committed to ensuring that you can continue to use it to build powerful solutions now and in the future.
That said, the VB runtime was built long before today’s cross platform world (on the VB6 platform which the Visual Studio team has talked about on UserVoice – see http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3440221-bring-back-classic-visual-basic-an-improved-versi), and with the significant investments we’ve made to run Office across multiple platforms, we want to bring all the great scenarios VBA enabled into this new world and we also want to take advantage of the new opportunities this new world creates for our customers. This has caused us to explore new approaches in order to address the new opportunities of a cloud anchored, cross device world (service connectivity, cross-platform authoring and execution, standards-based languages, cloud based deployment/management, and more).
We’ll be actively communicating these changes as they happen via the developer blog at http://dev.office.com/blogs, and appreciate your support and feedback as we release these updates, since your feedback is what allows us to ultimately end up in the right place.
86 commentsComments are closed
Eh Jh commented
Sam Isaacson commented
please bring back the offline help pages!
please bring back the offline help pages!
Microsoft lost more than they knew when they abandoned VB6 programming. Don't make the same mistake with VBA programming.
Zev Spitz commented
(Continuing my previous comment) In fact, the Excel / Office team would only be required to implement a langauge server for VBA (https://langserver.org/) which could communicate via the Language Server Protocol. I imagine COM addins could be used to enable JSON-RPC which is used by the LSP.
VS Code should be considered as the default client for such an integration, but any editor supporting the LSP could be used.
This would free up the team from having to create, debug and test the UI almost entirely.
Please be serious and think about the corporate user who work with VBA. The VBA Editor is like a dinosaur in terms of looks and some missing functionality (themes with more than 16 colors, syntax highlighting, minimap, word completion with intellisense, multiple line editing, etc.)
VSCode is a perfect solution for programming with all of its functions, plus color scheme and syntax highlighting (like Monokai ... that would a great improvement.
please bring back the offline help pages!
Zev Spitz commented
Consider integrating VS Code into Office (https://excel.uservoice.com/forums/304921-excel-for-windows-desktop-application/suggestions/20010145-integrate-vs-code-into-excel-at-the-same-level-as). This would allow the use of an advanced code editor with debugging capabilities, without making any changes (or perhaps some minor changes to allow debugging) to the VBA interpreter. It would also further the cross-platform goal, and provide a shared code editing/debugging experience for all languages/platforms (office.js already has type definitions on DefinitelyTyped, and thus Intellisense in VS Code).
Jan Wx, NZ commented
Rather focus on keeping an OO language going and please for goodness sake do something about the performance. 2016 is measurably 10x slower than 2010, some silly programmer stuffed up somewhere (and 3x slower than 2013). If it works don't touch it :) and don't make it worse
Here's how Excel's (and Word's) Macro Recorder could be improved in a HUGE way:
Give the user the ability to change the macro's programming language, on the fly, while editing. That's right, the macro editor should have a built-in language converter.
This would not be limited to record-time, where if a macro is recorded in Python syntax, it would stay in Python. Rather, the editor will be able to translate from one language to another while editing just by the user selecting a different language from a dropdown.
This will attract more users to use macros, and make it easy to invest their time in learning a language.
THE EVEN BIGGER PICTURE:
Ultimately, Microsoft ought to include this macro recorder and language translator in *ALL* their Office and Windows products, and Windows itself (both desktop and mobile).
This will not only make all their products more usable and easy for novices to program (and learn to program), but it will give Microsoft a HUGE edge over their competition at Apple, Google, etc.
BRING BACK EASY VISUAL PROGRAMMING FOR THE MASSES:
1. The macro editor should support a GUI UserForm editor, where you can drag-and-drop controls onto a form, and easily double-click on them to edit their code, etc., just like in the main MS Office products, Visual Studio, and VB6. Make it easy for the regular user to harness the power of their computer in general.
2. Make it easy to use Web-based APIs: there should be a simple GUI way to reference a Web API, like VBA currently lets you reference a COM object. You reference the library, and then you can just dim a variable as whatever types the library makes available, and you get Intellisense for all the methods. You can examine the class in the object explorer, etc.
This is 2017, let's get back to making programming EASY again, and empower regular people to automate their tasks! Visual Basic 6 and VBA were a revolutionary step forward with this, but somewhere along the way, mainstream programming languages and tools threw away a lot of the ease of the visual programming aspect. The expectation changed to be that the user should educate themselves, but the truth is that a lot of the best practices and concepts are more complicated than ever. If anything, there is just more out there. Way too much information to have to know for the casual person to be able to effectively program. With VB 6 and VBA you didn't have to learn 1000 different frameworks and design patterns and protocols, it was possible to just kind of wing it. As long as you knew some basics of procedural and OO programming, you could reference a library and figure it out with IntelliSense and the object explorer. The world needs this kind of ease again, badly.
First, I have a concern about making the macro engine cloud-based. One of the best things about desktop Excel is the immediate responsiveness, and that you don't have to be online to use it. And one of the best things about VBA in general is that with COM you can automate many many other applications on your computer, and integrate them into Excel, right from your Excel (or Word, Access, etc.) macro. This makes VBA extremely useful as a general tool for Windows. To make it cloud-based would introduce some things I am not too excited about:
1. Dependence on an Internet connection
2. Dependence on 3rd party Web service APIs. How many times have you found an old URL has changed or the site taken down? When you have an application installed on your computer locally, you know it will always be there (unless your computer dies, and even then as long as you have the install CD or backed up your PC, you have a fallback plan.)
3. Laggy performance and user experience compared to desktop applications. The Web-based experience just doesn't equal the desktop experience.
4. The whole cloud movement basically gives you less control over your own computer, and forces you to rely on fragile dependencies.
a listbox with multiselect set has no control source, the developer has to write code to populate a cell or range of cells with the selected items from the listbox. The Control source should allow either or both of: a) single cell control source where all input values appear as a string in the cell (with a delimiter like ";"), or the control source should be a range of cells equal to the length of the row source
Number kruncher commented
There are many routines posted in forums that will fill the spaces with blanks or use the Send Keys approach, however, these have proved unsuccessful for many.
Please provide a better programming environment for Excel. Some of my clients are die-hard excel fans for some reason, and doing VBA in excel is a nighmare compared to Access and vb.net in VS.
Hello in a VBA macro the following Exit statements are missing:
As a workaround one can use the 'Goto' statement for exiting a loop. These statements are currently only available in VB.NET, see for more background information the following website:
It would be nice if these statement are also compiled in a VBA macro.
Hideki ASHIDA commented
I've made some macros (wrote VBA code) for over five years.
My requirement, first of all, is a feature of "Folding" code block.
The more code written, the poorer visibility, i.e. hard to overview the whole structure of codes.
In addition, it becomes hard to jump to a line where I need, i.e. requires much scrolling.
"Notepad++", for example, is a freeware. Nevertheless, it has such feature, so it is easy to see and write codes with using "Notepad++".
Please make VBE have a feature of "Folding" code block.
Thank you, in advance.
Andrew Jackson commented
I'd like to be able to read and write built-in and custom VbProject and VbComponent properties. For example, the VbProject's Conditional Compilation Arguments, GUID and character encoding.
The VB6 VBIDE model already has ReadProperty and WriteProperty methods on VbProject and VbComponent objects, but these properties are only for user-defined properties, and they're not available in VBA's VBIDE object model..
Modern Office object models expose BuiltinDcoumentProperties and CustomDocumentProperties properties, so perhaps VbProject could add BuiltinProjectProperties and CustomProjectProperties, and VbComponent could add BuiltinComponentProperties and CustomComponentProperties?
That would allow enumerating, reading and writing properties that are built-in and/or user-defined, and it would follow the modern Office conventions.
The following two Exit Statements are missing in Office VBA when one wants to Exit the function block While-Wend or Select Case-End Select:
It would be nice if these statemens would also be available/compiled in VBA like in VB.Net, see this link for more information about Exit Statements: