I have an interview coming up for a VBA job. I didn't apply for it and was just asked to come in for an interview so I figured, "why not?" I havent used VBA in a couple years and while I'll do a little freshening up myself, I was wondering if anyone knew of any "gotcha" type VBA questions that might show up in an interview.
Outside of the pain that is VBA, just spend a few minutes brushing up on error trapping, variable scoping (global, local) and Office interop stuff. If you have been writing code in the last 2 years outside of VBA, you should be able to apply concepts that you have learned doing that to approaching VBA projects.
Firstly I think you have to look at why you are going for this job at all. Looking at your answers to other questions on SO, you seem to have an interest in PHP and jQuery, so web based development. VBA is a long way from that. While it is good to take advantage of opportunities that present themselves, you don't have to take advantage of all of them. Pick, or seek out, opportunities that are right for you and that you can see yourself being happy with. Can you see yourself being happy at this job, with this company, doing VBA programming for the next 2 or more years? Does this progress your career in the way that you want to go? If not, and you want to leave your current job, then hunt out other opportunities as well and pick the right one for you.
Secondly, VBA probably means the Microsoft Office realm. There have been some advances here, namely Visual Studio Tools for Office. Have a read up on that and maybe you can help this company move their development to VSTO, giving them a better platform for their code and a better development experience for you. This could give you something a little different to discuss at the interview.
Lastly, to remain on topic, here are some VBA questions:
- What is COM and how do you use COM objects?
- How do you connect to a database in VBA? (ADO, OLEDB, ODBC)
- What does DoEvents do?
- What do ByVal and ByRef mean and which is the default?
Lots of things that are "gotcha" type questions are simple things that will pop up in your IDE or can be searched for easily so any questions about "what does xyz property/method/event do?" are really fairly pointless in an interview.
I learned programming by cutting my teeth on VBA with MS Access and Excel. Lots of businesses, for better or for worse, use Office programs and VBA to solve major business problems, and lots of their solutions heavily rely on VBA.
I'm not aware of any specific questions that I would look for in regards to VBA. You might pick up a copy of the excellent VBA Developer's Handbook and skim through it so that you have a cursory knowledge of everything VBA can do.
Personally, I would emphasize how I can solve problems and write maintainable code in VBA. A lot of businesses have critical solutions sitting in VBA code and have experienced the pain of trying to maintain Excel workbooks with monolithic 800-line subroutines that each do thirty things; the maintainance occurs, of course, about 3 years after the person who wrote the code left the company. If you can explain how you implement good software design principles in VBA so that complex solutions can be better maintained, you will sell yourself as a very valuable asset to the business.