Ans: VBA stands for Visual Basic for Applications; it is an event driven programming language developed by Microsoft. It is predominantly used with Microsoft office applications like MS-word, MS-Access, and MS-Excel.
Ans: Data types helps to declare Variables with specific data, this helps to VBA to know the type of the data and assign the memory based on the DataType of the Variable.
Ans: We can define variable in different levels:
Ans: MsgBox is a built in VB function which displays a Message Box and MsgBoxQ is a function defined by the user.
Q5. Where you can write your VBA program for Macro?
Ans: vModule is the place where you can write VBA program for Macro, to insert a Module navigate to Insert -> Module
Ans: Coursor types:
Lock types :
Ans: In VBA, soon a variable goes out of scope, the reference counter on the reference object is decremented. When you assign the object reference to another variable, the reference counter is incremented. While when your reference count reaches to zero it terminates the event.
Q8. Which controls have refresh method, clear method?
Datagrid,listbox,combobox,label,button have refresh methodand textbox has clear methodalmost all controls have refresh method
Ans: The Controls which do not have Align property can't be placed on MDI Form.
E.g., Picturebox only has Align property in Standard Components of VB other controls dont have align property an hence can't be drawn on MDI Form.
Timer control can also be placed on MDI form.
Ans: In VBA, variable can be declared with the keyword “DIM” while constant is declared with keyword “Const.”
Ans: The chief use of VBA is to make use of its special function which helps in repeated actions. Goal seek function helps to reduce manual entry of the code each and every time. This solves the problem of repeated function entry by automating functions and actions. Sub routines are inserted into the using the VBA editor and command insert module.
Ans: Format functions can be used to format many of the expressions such as currency, time, date, percentages and numbers. These functions are much simpler to use in VBA. User defined date, numeric and string formats are present in many of the applications.
Ans: Comments are used to document the program logic and the user information with which other programmers can work seamlessly on the same code in future. There are mainly two methods in VBA to represent comments.
Ans: When arguments are passed to VBA functions, they can be passed in two ways
Ans: The VBA (Visual Basic Information) have flexible applications, but there is a limitation to a function pointer in VBA. Windows API has inadequate support for function pointers because it has the ability to use the function but not the functional support to call back the function. It has inbuilt support for the call but not for a callback.
Ans: Option Explicit makes the declaration of Variables Mandatory
Ans: “Option Explicit” makes the declaration of variables mandatory. Line explicit function makes the compiler to determine all the variables that are not declared by the dim statement. This command diminishes the problem of type errors significantly. It is used in VBA because it deals with information rich application in which type errors are common. Before starting any, sub-procedures it can be used inside a module.
Ans: To decrease the reference counter explicitly, you need to set a variable to “Nothing”.
Ans: Line explicit function makes the compiler to identify all the variables which are not specified by the dim statement. This command significantly reduces the problem of type errors. This is used extensively because VBA deals with information rich applications in which type errors are common.
Ans: COM objects are usually .dll files, and are compiled executable programs.
Ans: Visual basic is useful if you are planning to develop your programs from scratch. This language helps you in developing Active x controls, exe files, etc.
Visual script is a powerful tool, through which you can create small scale applications on web pages, automation applications, etc. Integrated development environment is not present for VB script.
Visual basic applications are very useful in automating your existing application. VB application is useful for developing already existing applications.
Ans: Stretch
Ans: 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.
Ans: If you pass an argument by reference when calling a procedure, the procedure access to the actual variable in memory. As a result, the variable's value can be changed by the procedure.
If you pass an argument by value when calling a procedure, the variable's value can be changed with in the procedure only outside the actual value of the variable is retained.
Passing by reference is the default in VBA. If you do not explicitly specify to pass an argurment by value, VBA will pass it by reference.
Argument Passing ByVal
Describes passing arguments by value, which means the procedure cannot modify the variable itself.
Argument Passing ByRef
Describes passing arguments by reference, which means the procedure can modify the variable itself.
Ans: Setabort and setcomplete method are called from the ObjectContext object to notify MTS that the transaction was unsuccessful or unsuccessful
Ans: MultiLine Property
No limits
Q28. What is the code to find a last used Row in a column or last used Column of a row?
Ans: To find the last row in a column, the command used is End(xlUp) and to find last column in a row, the command used is End(xlToLeft).
Ans: Data validation is an important concept in VBA. Application procedure and a custom dialog box can be used to correct input errors. You can assign an application procedure to the frame of a dialog box. Error message or custom dialog box can be highlighted with the first field with errors.
Ans: In order to dial a phone number through VBA, you need to follow the following steps
Ans: 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.
Ans: The difference between the Subroutines and Functions is that