Open In App

Application Objects in Excel VBA

Last Updated : 29 Oct, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The Excel VBA Application object is one of the most commonly utilized objects when using VBA to automate any task. It uses several Excel programs and runs various operations on Excel Workbooks. To work with the Excel Application Object, it has many Properties and Methods. Below is a brief description of each of the most useful Properties and Methods when automating any task.

VBA Application Object Methods in Excel

Calculate Method 

In VBA, the Calculate Application Method is used to calculate all open Workbooks, a single Worksheet, or a range on a worksheet.

Syntax

In VBA, the Calculate method of the application object has the following syntax:

Application.Calculate

Example:

Syntax-for-calculate-method

 

The macro above is used to perform calculations in a specified Worksheet.

CalculateFull Method 

In VBA, the CalculateFull Application Method is used to force a full calculation in all open Workbooks data.

Syntax:

Application.CalculateFull

Example:

Syntax-for-calculatefull-method

 

The macro above is used to force full calculations in all open workbooks data.

FindFile Method 

In VBA, the FindFile Application Method is used to display the Open dialog box, which allows the user to open a workbook or file. This method returns either True or False as a Boolean result. If the value is true, the user has successfully opened the file. If the user closes the dialog box, the value is false.

Syntax:

Application.FindFile

Example:

Syntax-for-findfile-method

 

The procedure above displays the open dialog box and opens the selected file in Excel.

Goto Method

In VBA, the Goto Application Method is used to pick any range on a worksheet or any visual basic process in any workbook. If the selected worksheet is not currently active, it is activated.

Syntax:

Application.Goto (

Example:

Syntax-for-goto-method

 

The procedure outlined above Chooses cell ‘C100’ from the Example1 worksheet. And the ‘Scroll:=True’ sentence below scrolls through the worksheet.

Run Method 

The Run Application Method in VBA is used to execute a procedure or function defined in Visual Basic.

Syntax:

Application.Run(
 

Example:

Syntax-for-run-method

 

Wait Method 

In VBA, the Wait Application Method is used to pause or stop a running macro until a defined or specified time. It returns either true or false as a Boolean value. It returns true if the specified time has arrived; otherwise, it returns False.

Syntax:

Application.Wait(Time)

Where
Time: It is a necessary parameter. It defines the time at which you want the macro to resume.

Example:

Syntax-for-wait-method

 

The macro below pauses a program until 6 p.m. today.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads