Advanced VBA Interview Questions and Answers

Advanced VBA Interview Questions will be asked to check your level of expertise in VBA Advanced Concepts. Here are the top most Advanced VBA Questions and Answers covered from Advanced concepts of VBA Programming.

Option Explicit force the variables to be declared befre using the variable. This is one of of the best practices for VBA developers to avoid the type errors and build the error free applications.
Code Module: Default Modules which we use to write all procedures and functions
UserForms: UserForms helps to develop GUI (Graphical User Interface) applications.
Class Modules: Class module allows to create new objecs and define methods, properties and events. Also, it will allow to enhance the existing objects.
Procedures or Subroutines will not return a value; functions will return values.
Arguments can be passed in two ways in VBA Subroutines and Functions:
ByVal: When an argument is passed By Value, the value assigned to the argument is passed to the procedure. And any changes that are made to the argument inside a procedure, it will be lost when the procedure is ends.

ByRef: When an argument is passed By Ref, the actual address assigned to the argument is passed to the procedure. And any changes that are made to the argument inside the procedure will be passed when the procedure ends.
And By Ref is default in VBA.

Workbook, Worksheet modules are Class modules.
User forms allows us to develop Windows applications. We can use readily available ActiveX Controls to design and develop Windows Applications.
ADO stands for ActiveX Database Objects.

ADO Objects: Connection, Command, Error, Field, Record, RecordSet, Parameter, Property, Stream

VB6: Visual Basic is Windows Application Development Programming language developed by Microsoft

VBScipt: Visual Basic Script is mainly developed for Internet Explorer. Similar to Java-script.

VBA: Visual Basic for Applications is a Macro language available in all MS Office Tools.

VB.NET is a one of the .NET programming language from Microsoft. We can develop COM Add-ins for MS Office using VB.NET or C#.NET.

VBA Does not support all the OOPS techniques (VBA will support Polymorphism, Encapsulation and not Inheritance). So, its generally called as Object Based Programming Language.
Type casting it converting data from one type to another data type. Example we can use cStr() function to convert the data as string type.
  • MsgBox, InputBox
  • Left, Right, Trim, Len
  • Mid, InStr, Split
  • IsNumeric, Round, Now, Format
TextBox1.Text will read as string

TextBox1.Value will read as numeric (integer/long/double)

Here is the link for more VBA Interview Questions and Answers. These are explained for examples.
100+ VBA Interview Questions