Basic VBA (Visual Basic for Applications) Interview Preparation Guide
Download PDF

VBA Frequently Asked Questions in various VBA (Visual Basic for Applications) Interviews asked by the interviewer. So learn VBA with the help of this VBA (Visual Basic for Applications) Interview questions and answers guide and feel free to comment as your suggestions, questions and answers on any VBA (Visual Basic for Applications) Interview Question or answer by the comment feature available on the page.

39 VBA Questions and Answers:

Table of Contents:

Basic  VBA Job Interview Questions and Answers
Basic VBA Job Interview Questions and Answers

1 :: What is function of delete operator?

As the name suggests, the purpose of delete operator is to remove the concerned object.

2 :: Name of some control used to call a windows application?

OLE is the control used to call a windows application.

Call Shell(stAppName, 1)

4 :: Name the platforms through which visual basic applications are available?

Most of the visual basic applications are available on 32 bit Intel platforms. These applications also run on many of the windows software systems such as server 2003, XP, Vista, etc.

6 :: Explain What forms should be used for Complex user Input?

Userforms should be used for complex user input. When an application input has non text as an input it is advisable to use Userforms rather than the input boxes. When you are using Userforms a user can give input any number of times which is not the case when you use input boxes. This can be accessible from the insert menu in your VBA editor after which you can insert your code.

7 :: What is the security vulnerabilities for VBA?

Microsoft Visual basic has its host of problems one such being macros, Macros can be created which can create a havoc for a programmer with good intentions. Also the security issue rests in the hands of the user and not the programmer as such. A user can manipulate the VBA document.

8 :: Explain 3 main differences between flexgrid control and dbgrid control?

1. Datagrid is Editable, flexgrid is Diplay only.

2. DBGrid allows full data binding while MSFlexGrid allows read-only binding

3. MSFlex grid is smaller and allows cell merging while Datagrid is larger and does not allow cell merging

9 :: What is Constructors and distructors?

when we initialize the form at that time if we want to set any variable's value then we can set it by defining in constructor. constructor 's name always same as class name.and destructor is used to recover memory occupied by any variable defining in constructor.

constructor and destructor is the new way in object oriented languages to initialize the varibles at the time of object creation.
when we declare an object,we can pass the values to it,and that values will be assigned to the data members of that class,whose object it is.
a class can have no. of objects and no. of constructors. an constructor is called automatically when an object is created.
there is only one destructor in any class,that is to deallocated the memory of the object when an object is destroyed or no longer exist

10 :: What is visual basic and its importance?

Microsoft holds license for Visual basic applications and it has been developing that language. Visual basic applications have an embedded programming environment which assists programmers in developing custom solutions by using almost all features of visual basic. Applications which are currently hosting visual basic can fully utilize the power of Visual basic applications because they have an added functionality and ease of visual basic applications.

11 :: Explain the interpretation features of VBA?

VBA is licensed to Microsoft and this compatible with and only Microsoft products. Code written is compiled by an intermediate language called P-code and this is stored in hosting applications such as Excel, Word and Access. The intermediate code is interpreted by a virtual machine. This code and intermediate language is the exclusive right of Microsoft.

12 :: How to use the Getsetting and Savesetting functions to read and write registry settings?

A computer registry can be used to store configuration settings and application initialization. We can use Getsetting function to read registry settings and save settings function to write registry settings. Application name, section, key, setting, and default are to be specified for registry modifying. It is advisable to know about your computer settings before modifying registry settings.

15 :: How to dial a phone number?

Shell command present in VBA can be used to start the dialer present in windows operating system. Phone number can be used to connect to your modem. With the use of shell and sendkeys you can dial to your user. Shell starts windows application and sendkeys inform the window to dial according to the keystrokes of the application. A macro can be used to start the cardfile program which activates the auto dialer feature.

16 :: Explain What are the different compatibility types when we create a COM component?

No compatibility - creates new GUIDproject compatibility binary compatibility - maintains the references

17 :: Explain some general uses for Visual basic applications in general context?

Visual basic can be used within almost all Microsoft products such as Map point, Visio, Auto cad, Word perfect, ArcGIS, word, excel, etc. With VBA you can control many functions such as host application, menus, toolbars, user interface, import and export of files, data transfer and extraction from multiple interfaces.

18 :: Explain VB and Object Oriented Programming?

VB do supports oops.

Polymorphism - Yes , Encapsulation -Yes, Inheritance - NO

19 :: Explain How to register a component?

To register component use

run command prompt type:

c: regsvr32 nameofcomp

For Activex DLL use:
RevSvr32 nameOfDll
For Activex Exe use:
NameOfExe /regServer

20 :: Explain about COM add-ins?

COM add-ins are software program`s which are integrated into an application and they add already built in features to an existing application. They have common architecture across multiple applications which help in deploying applications much faster across varied applications. Microsoft 2007 supports various COM add-INS

21 :: Explain technical reasons which made Microsoft withdraw its support for VBA in Mac?

The reasons which made Microsoft drop its support to VBA are as follows, Microsoft visual basic relies heavily on machine code which was written for Power PC architecture. Also it would take another two years for developing VBA support for its architecture. It also states that Microsoft will incorporate VBA in the next script of office release for Mac.

22 :: Explain Advantage of ActiveX Dll over Active Exe?

Advantages of ActiveX Dll

1) An in-process component shares its client?s address space, so property and method calls don?t have to be marshaled. This results in much faster performance.

Disadvantages of ActiveX Dll

1) If an unhandled error occurs it will cause the client process to stop operating.

Advantages of ActiveX Exe

1) The component can run as a standalone desktop application, like Microsoft Excel or Microsoft Word, in addition to providing objects.

2) The component can process requests on an independent thread of execution, notifying the client of task completion using events or asynchronous call-backs. This frees the client to respond to the user.

3)If an error occurs the client processes can continue to operate.

Disadvantages of ActiveX Exe

1) Generally slower than an ActiveX dll alternative.

23 :: Explain Benefit of wrapping database calls into MTS transactions?

Benefit of wrapping database calls into MTS transa...

If database calls are made within the context of a transaction, aborting the transaction will undo and changes that occur within that transaction. This removes the possibility of stranded or partial data.

24 :: Explain Type Library and what is its purpose?

Type libraries are files that explicitly describe some or all of the contents of components. This includes information about the methods, properties, constants, and other members exposed by the component. Development tools such as Visual Basic make use of the information contained in the type library to help you, as a developer, access and use the component. In addition, type libraries provide a convenient way to include a simple level of descriptive documentation for component members.