Why is vba so bad




















NET has been dropped in it. This is the first time that MS has actively started to remove VB support from part of its ecosystem. Traditionally it was just kept on the back burner or given as an "extra" example. But now, for the first time, it is actually being left out. That enabled it to be used on smaller systems with a magnetic tape drive rather than an expensive card reader.

BASIC had the same pupose as Fortran, for use by scientists and engineers to create small routines to solve mathematical problems and sort lists. It is an object orientated language derived from Lisp, a string handling language used for expert systems. COBOl is not really a language at all but a script.

It was used by very large businesses to do very simple things with a very high degree of repitition - for instance, calculating and printing bills for customers of a gas supply authority. That's not accurate. It's very much a language. In every sense. And a compiled one, so not a script at all. If you try Lisp, it takes two seconds to realize it's not even related. Your information isn't just wrong, it's bizarrely wrong. Lisp is a functional language and cannot be made object oriented.

And it can't be written like an imperative language. They are wholly different things. But VB isn't a string handling language, nor functional, nor useful for expert systems. I started with basic when I was 10 I remember, so that was like I found it interesting but it never inspired me. Then i discovered c which was worlds different and just beautiful. Just my personal experience is all and I know it will be different for everyone. I dabbled in Fortran and liked it but never learned it.

I don't know why, was probably too busy chasing girls:. I also dabbled in vb but hated it. To me, it just made no sense and everything was harder to accomplish anything.

So, to me my opinion is a little different than yours on this, I still think plain vb was horrible and should be scrubbed from the face of the earth. I went back to the c family and never looked back. I should really see if there is a more modern implementation of Fortran, I thought ti was cool when I was a teenager lol.

Just my opinions from personal experiences so not an attack on anyone else's experiences because they could be much different than mine. Not too dissimilar. Did C a little later, then dabbled in Lisp but never really got it. Still used, insanely fast. Compiles through the same pipeline as some of the best C code. Yeah that's pretty much my opinion too.

I guess it made more sense to others but not me. Register Login. Reply Reply as topic. This topic has been deleted. Only users with topic management privileges can see it. In some circles read: communities I've seen it hover around the number one recommended environment for the SMB to write in house software Wow, there are no words Edit done, you can actually read it now. Now as Windows grew up they needed more and more power from basic to do the things that they needed to do to compete with new languages and new paradigms that are coming out on other platforms eventually BASIC gave way to Visual Basic which was still BASIC just with a lot more stuff added to it.

It was designed for use by financial departments and is still used on Wall St. Whatever that is, you can't even Google it, literally zero results. I don't know why, was probably too busy chasing girls: I also dabbled in vb but hated it. Cobol is about the same degree of terrible as vb. With just a few lines of code, I am manipulating thousands of lines of data within fractions of seconds. I start to get fancy and make interfaces with buttons and sliders.

I figure out how to pull data from the internet. I finally come to the realization that I can easily figure out how to do virtually anything I want with VBA and Excel and my whole world changed. There are examples of using VBA to build games with opponent AI, animated charting, and business management interfaces. You can truly do amazing things with this simple language! Learning how to use VBA is a very quick way to differentiate yourself from the millions of other Excel users throughout the world.

Excel users instantaneously associate folks who utilize VBA as an advanced user and will look to them for help. VBA is a language that is been around for a long time and because of this, there is a tremendous amount of documentation and help available to us.

Forum help was a major source of education for myself as I taught myself VBA or explored for ideas on how to tackle an automation I wanted to implement. The Excel VBA community is absolutely one of the most generous and responsive online communities out there and it is because of this, that folks are able to take advantage of this language everyday! Proposals for new capabilities, efficiencies, and more modern functionality have all been seemingly ignored in the hope that we the users will just get tired of asking.

This period of silence over the last 10 odd years has driven a lot of confusion among Excel users as to if the VBA language is even supported anymore. Lets circle-back to those shiny new Waterfall charts Microsoft released into Excel a couple of years back. I worked on a consulting project where I was building an Excel add-in that would automatically create and format of a variety of different charts.

For example, the client wanted a bar chart with certain coloring and font formats. I used the macro recorder, re-created the chart in Excel to their desired specifications and I was off to the races whipping up a nice clean macro to automate the chart creation. I turn on the macro recorder, build the Waterfall to the exact specs, and guess what shows up in my Visual Basic Editor?

Well, the written code started off with the creation of the waterfall which was good! The book is written in bite-sized chunks covering a lot of Excel functions and features.

YakshChauhan Thanks so much for commenting. This blogpost was meant to be cautionary. There are good reasons to use VBA. I wrote a blogpost in support of using VBA.

Excel ran for 4 days by itself. In many cases, the lack of Undo can be obviated by simply closing all other files and saving the file s to be operated on by the macro, before launching it. I always do this.

If I get a weird result, I just close without saving. If a macro involves changing and saving a file, save it somewhere else first. If it involves changing and saving many files, try to keep them each small and noncritical. Ok Oz. So I should avoid using VBA. All the automation and scripting that gets the job done? If you have a better solution that is preferable, instead of using VBA, please share. The article is just 6 reasons not to use VBA.

There are plenty of reasons to use VBA. So are you ready for a comment six years later? I actually found this blog subject while searching for a more insidious undo problem.

If, for example, I accidentally delete the contents of a cell, unless I have a good photographic memory of what was there before I made it disappear, that change is lost forever. The problems you have had, I have faced and overcome; that is, these for me do not exist. So look for other pretexts to stop using Excel VBA.

This was a cautionary warning. I wrote a blogpost on reasons to use VBA. That said, the more experienced you are in VBA or coding, the quicker you can turn out a reliable solution. If someone just records a macro and expects it to work the same way on differently formatted sheets, etc. Also, recording the macro with relative references can help. First rule of computers, save your work often! At the end of the day I might have 50 versions. Sadly in this day and age computers still crash, what can you do?

Second, good programming design is to non-destructively edit the data. If you want to delete rows and have some method of rollback, maybe instead of deleting, have your macro create a copy of the worksheet with the rows you want to keep or make whatever changes you want there.

The macro could automatically save a backup copy of the workbook before proceeding. There are a million ways around this problem. This one is silly. Of course, when designing ANY software or process, we should consider the users and user experience.

A well designed application or macro comprehensively prompts and displays status to the user, catches errors gracefully, and manages their experience overall. The job of a programmer is to foresee scenarios like this and design for it.

But at the other end of the spectrum, programming using extreme OOP design patterns can cause headaches too. Have you read my responses to this? Especially my Medium article.

Often we build spreadsheets for other people, and Excel is unique in the way that users often need to make modifications to calculations, the layout, etc. So, it helps to be in their world. And there are times when there is no avoiding VBA.

In those cases, fine. Use VBA. You big dopies. You always always make a copy of the master sheet and then apply the macro on the copy so that you can compare the original to the modifield sheets. That way the undo issue is a nonissue. Sheesh vba excel is the best. Hi Oz, you are one the few from the few. At office , if the code of the add-in has active lines on Error Error Resume Next, then when running macros that worked in , there will be an error Appliction-defined or object-defined error.

Now I do without Resume. It has been successfully tested both by units and manually. The copying instruction itself is good — the compiler added an error to it if there was a loss of type in the hierarchy — some other function took the WorkSheet argument, and they started giving it Nothing — and the VBE error is not at the place of type loss, but where the hell where you never think of something — copying a sheet.

And VBE beat a mistake evil tore on a distant function with a copy of the sheet. While I agree with everything you said, I think you missed one critical problem with VBA; references.

I wish this was something the VBA team had addressed in the past. There are other minor annoyances; phantom breakpoints, source vs p-code getting out of sync, etc. Truth is, any non-trivial piece of code can break in many non-trivial ways… VBA just happens to not be an exception. I work with 6 monitors and stretching the VBE parent window across them is painful and still makes it a pain to manage the active code windows.

It means you can set up a central error-handler and then, usually, forget about error-handling. If you want to catch specific errors you can do that to. Brilliant product and, no, I am not the author.

Created detailed, table formatted email reports that are auto generated after reviewing and scraping a complete data sheet — this single macro alone saved my boss hours of manual work during our most key busy time of the year.

If someone hates VBA, they simply need to study more. I do myself — I can only imagine what I am to learn next. You are commenting using your WordPress. You are commenting using your Google account.

You are commenting using your Twitter account. You are commenting using your Facebook account.



0コメント

  • 1000 / 1000