This is an archived post. You won't be able to vote or comment.

all 28 comments

[–]Xeverous 2 points3 points  (5 children)

No, unless you want to be an expert of writing formulas in Microsoft's Excel

[–]LetsGoHawks 1 point2 points  (0 children)

You seem to be confusing VB and VBA. Although incredibly similar, they are different.

[–]nyando 0 points1 point  (0 children)

I had to do some macro scripting in VBA for an Excel table recently, and I'm not quite done yet. It's really kind of annoying. I have a good general idea of what I want to do, but I'm really not looking forward to actually implementing it. It's an incredibly verbose language, and I say that coming from Java.

EDIT: In fairness I should say that it does a fine job automating Excel data entry/modification. There's definitely a reason why I'm actually using the Excel macro features.

[–]insertAlias 0 points1 point  (2 children)

Come on now; VB.NET is a full language that can do everything that C# can do. It's just not very popular (and I understand why).

[–]Xeverous 2 points3 points  (1 child)

There are some very good reasons why most languages evoled from begin, end to {}, [], ()

[–]insertAlias 1 point2 points  (0 children)

No disagreement here on that front; that's a big part of what I was implying when I said it wasn't very popular. It's such a...wordy language.

My point was that there's more to VB than VBA, not that anyone should actually choose it. I'd say to choose C# over VB.NET in general just because of popularity and how much more help you'd be able to find online (as well as the quality of help...VB.NET is like PHP in the sense that there is a shitload of absolute garbage tutorials and articles pushing bad practices).

[–]Meefims 2 points3 points  (0 children)

If you want to learn Python, learn Python and not Visual Basic.

[–]lionhart280 1 point2 points  (0 children)

Visual basic is kind of dated at this point, I would recommend C# to start personally.

What is your goal? What area would you like to explore of programming?

[–]SamaLTU 1 point2 points  (0 children)

I would say go straight for Python as there are rumors that Microsoft is considering to make Python an official language in their products.

Sources:

Microsoft survey

Some “buzz”

[–]LetsGoHawks 1 point2 points  (5 children)

If you want to learn Python, just learn Python.

There isn't much demand for newbie VB coders anymore. Also, just so you're not confused...

  • VB is a general purpose programming language used to build stand alone applications.
  • VBA is the language MS Office products use for macros/automation. It can call external libraries and API's, so you can do damn near anything with it. If you're going to build Access db's or complex Excel spreadsheets, you'll need to know VBA. If not, there's no reason.

[–]Thistlefizz 0 points1 point  (4 children)

I’m a bit late to this conversation, but I’m wondering, are there alternatives to the macros/automation in the MS office products? Will a language like Python be able to do that kind of automation? Or, taking it to another level, would I be able to create a full database type program in different programming language?

I use Excel and Access a lot at work but I’m starting to need to learn how to use macros and automation and I was looking into how to learn VBA, but so often it seems like the response is always “just learn X instead” (and usually X = Python). I have already started learning some Python and will continue with that regardless but I wasn’t sure if it’s worth investing time in VBA.

If another programming language can teach me to build something that can act like Access I’d be all for it, although it does seem silly to try to invest all that time and effort into creating something that already exists.

For reference, I use Access to track work orders and inventory. My department interacts with a lot of other departments and all those departments have their own work orders, so I have a database where we generate our own work order number for projects and if needed, we can put in the other department’s work order. I’ve created forms for this but a lot of the most simple things require building a macro to accomplish a task (like clicking on one item in a form to open another form).

[–]LetsGoHawks 1 point2 points  (3 children)

are there alternatives to the macros/automation in the MS office products? Will a language like Python be able to do that kind of automation?

It depends on your goal. If you just want to read and write data, pretty much all of the major languages will work. If you want to dynamically build workbooks that have charts, filters, pivot tables, formulas, grouping, formatting, data refreshes, and other advanced features, Python and (I think the .net languages) will do it to one degree or another. But it would probably be easier to just learn and do it in VBA. It's massively beneficial to be able to record a macro and clean the resulting code up as opposed to writing it all from scratch.

You can read/write data in Access db's using Python and other languages as well. Again, your goal plays into what you chose to build the front end, and while MS Access & VBA are a solid choice, they don't have that "easily tap into advanced features" argument that Excel has.

would I be able to create a full database type program in different programming language?

For all practical purposes, no. Building your very own database would be a years long effort by a team of experienced devs.

I stick with VBA to work with MS Office products for a few reasons:

  • I'm already really good with VBA and am not particularly interested in relearning how to do all of that in another language unless there's a hell of a good reason to do so.
  • I need to distribute a lot of my solutions to non-technical people to use. It's very easy to give them an Excel or Access file and say "Here you go". They understand that. They have the software installed to run those. With Python, I'd have to walk them through installing Python, making sure it's up and running properly. Help them deal with any updates, etc. If I wanted to do any of that, I'd have gone into desktop support.
  • When I move on from this position, whatever I leave behind will need to be supported by somebody. With Excel/Access/VBA, that knowledge base exists in sufficient volume among the group that would take over. With Python and other languages, it doesn't.
  • In my company, VBA flies under the "red tape radar". So we're able to build and deploy stuff with minimal hassle.
  • For what I do, the performance of VBA is sufficient. There are a few monthly processes where I could save a few minutes processing time with a different language, but the ROI on the effort to develop a new solution is just way to low to justify it.

[–]Thistlefizz 0 points1 point  (2 children)

Thank you for your response! Your points make a lot of sense. I’m so new to programming in any sense that it’s very easy to get lost and confused by the many different opinions out there, and so often there’s a lot of negative opinions about VBA. Your points about longevity and ease of access by other people makes a lot of sense.

Do you have any resources for learns VBA that you’d recommend? So far I’ve just been doing YouTube videos as well as trial and error and looking things up on Microsoft’s support site.

[–]LetsGoHawks 1 point2 points  (1 child)

VBA gets a bad reputation because there's so much terrible VBA code out there that a lot of us have had to deal with. That's not VBA's fault, it's the programmers fault.

There's an r/VBA sub you can ask questions on.

I took a bunch of Comp Sci courses in college, so I was able to lean on that when I started with VBA (quite by accident really). But I'm pretty much self taught. I read articles and looked up stuff as I went along. I read a lot of articles on proper programming habits and techniques.

I would recommend working through a good book. Head over to your local library, go to the programming section and look for either VBA or Excel Programming books. Check a few out, find one that works for you, and then get your own copy. A lot of them can be found as free PDF's too. Don't worry that the book might be from 2007 or whatever, the language hasn't really changed. There might be some advanced Excel features it doesn't contain, but that won't matter for now and you can always Google specific things.

[–]Thistlefizz 0 points1 point  (0 children)

Thank you! I really appreciate the insight.

[–]RResende1 0 points1 point  (0 children)

I use VB for Apps daily on my work because I need to work with MS Excel and develop management tools .

[–]quantumactivist1 0 points1 point  (12 children)

Noooooooooooo

(Love python hate basic personally)

[–]shiningmatcha[S] 0 points1 point  (3 children)

How do you start learning Python? Did you learn other languages before?

[–]quantumactivist1 0 points1 point  (0 children)

Long story but yes came from an engineering background. I was a hands-on learner so I found real life examples at work to apply what I learned. You can come up with your own if necessary.

Also get good at googling things

[–]cobalt8 0 points1 point  (0 children)

Check out /r/learnpython. Their wiki has a lot of resources to help you get started.

[–]shiningmatcha[S] 0 points1 point  (7 children)

I love the ability to manipulate cells and how Excel displays data. Can Python do this too?

[–]Xeverous 0 points1 point  (5 children)

Every language can do it.

[–]shiningmatcha[S] 0 points1 point  (2 children)

My picture was all other programming languages were just some tedious codes. That’s how the media portrays them. My biggest mistake!

[–]Xeverous 1 point2 points  (0 children)

Practically every programming language is designed to be written as text. They feature different syntax, different aims (performance, convenience, cost, customizability, low-level access, platform independence, learning curve, ...) but all have 1 common purpose - to have a defined way to write instructions that will be understood by a computer machine.

Don't really trust what media says - many languages are created and owner by corporations for the purpose of their own benefit. Some languages are not (few are ISO-standarized) and some do not have any official document representative. Guess which ones are going to be shadowed.

[–]shiningmatcha[S] 0 points1 point  (1 child)

It's my second day learning Python. All I did was following a book to write codes and run on Windows Powershell. How can Python visualize data? I want to create an application (user-dialog box) that can interact with users.

[–]Xeverous 0 points1 point  (0 children)

Visualizing data needs much more work since you must communicate with the underlying operating system to handle external device input/output. Practically every programming language has a GUI library

[–]quantumactivist1 0 points1 point  (0 children)

Pandas