Class Application (Excel VBA)
The class Application represents the entire Microsoft Excel application.
Some procedures in this class have been grouped together in themes and are described on separate theme pages
Cell with its procedures ActiveCell, CellDragAndDrop, Cells, EditDirectlyInCell, LargeOperationCellThousandCount and ThisCell
Print with its procedures ActivePrinter and PrintCommunication
DDE with its procedures DDEAppReturnCode, DDEExecute, DDEInitiate, DDEPoke, DDERequest and DDETerminate
Enable with its procedures EnableAutoComplete, EnableCancelKey, EnableCheckFileExtensions, EnableEvents, EnableLargeOperationAlert, EnableLivePreview, EnableMacroAnimations and EnableSound
Name with its procedures GetOpenFilename, GetSaveAsFilename, OrganizationName, UserName and WarnOnFunctionNameConflict
Email with its procedures MailLogoff, MailLogon, MailSession and MailSystem
ActivateMicrosoftApp - Activates a Microsoft application. If the application is already running, this method activates the running application. If the application isn't running, this method starts a new instance of the application.
AddCustomList - Adds a custom list for custom autofill and/or custom sort.
Calculate - Calculates all open workbooks, a specific worksheet in a workbook, or a specified range of cells on a worksheet, as shown in the following table.
CalculateFull - Forces a full calculation of the data in all open workbooks.
CalculateFullRebuild - For all open workbooks, forces a full calculation of the data and rebuilds the dependencies.
CalculateUntilAsyncQueriesDone - Runs all pending queries to OLEDB and OLAP data sources.
CentimetersToPoints - Converts a measurement from centimeters to points (one point equals 0.035 centimeters).
CheckAbort - Stops recalculation in a Microsoft Excel application.
CheckSpelling - Checks the spelling of a single word.
ConvertFormula - Converts cell references in a formula between the A1 and R1C1 reference styles, between relative and absolute references, or both.
DeleteCustomList - Deletes a custom list.
DisplayXMLSourcePane - Opens the XML Source task pane and displays the XML map specified by the XmlMap argument.
DoubleClick - Equivalent to double-clicking the active cell.
Evaluate - Converts a Microsoft Excel name to an object or a value.
FindFile - Displays the Open dialog box.
GetCustomListContents - Returns a custom list (an array of strings).
GetCustomListNum - Returns the custom list number for an array of strings. You can use this method to match both built-in lists and custom-defined lists.
GetPhonetic - Returns the Japanese phonetic text of the specified text string. This method is available to you only if you have selected or installed Japanese language support for Microsoft Office.
Goto - Selects any range or Visual Basic procedure in any workbook, and activates that workbook if it's not already active.
Help - Displays a Help topic.
InchesToPoints - Converts a measurement from inches to points.
InputBox - Displays a dialog box for user input. Returns the information entered in the dialog box.
Intersect - Returns a Range object that represents the rectangular intersection of two or more ranges. If one or more ranges from a different worksheet are specified, an error is returned.
MacroOptions - Corresponds to options in the Macro Options dialog box. You can also use this method to display a user-defined function (UDF) in a built-in or new category within the Insert Function dialog box.
OnKey - Runs a specified procedure when a particular key or key combination is pressed.
OnRepeat - Sets the Repeat item and the name of the procedure that will run if you choose the Repeat command after running the procedure that sets this property.
OnTime - Schedules a procedure to be run at a specified time in the future (either at a specific time of day or after a specific amount of time has passed).
OnUndo - Sets the text of the Undo command and the name of the procedure that's run if you choose the Undo command after running the procedure that sets this property.
Quit - Quits Microsoft Excel.
RecordMacro - Records code if the macro recorder is on.
RegisterXLL - Loads an XLL code resource and automatically registers the functions and commands contained in the resource.
Repeat - Repeats the last user-interface action.
Run - Runs a macro or calls a function. This can be used to run a macro written in Visual Basic or the Microsoft Excel macro language, or to run a function in a DLL or XLL.
SendKeys - Sends keystrokes to the active application.
SharePointVersion - Returns the version number of SharePoint Foundation instances running at the site for the specified URL.
Undo - Cancels the last user-interface action.
Union - Returns the union of two or more ranges.
Volatile - Marks a user-defined function as volatile. A volatile function must be recalculated whenever calculation occurs in any cells on the worksheet. A nonvolatile function is recalculated only when the input variables change. This method has no effect if it's not inside a user-defined function used to calculate a worksheet cell.
Wait - Pauses a running macro until a specified time. Returns True if the specified time has arrived.
ActiveChart returns a Chart object that represents the active chart (either an embedded chart or a chart sheet). An embedded chart is considered active when it's either selected or activated. When no chart is active, this property returns Nothing.
ActiveEncryptionSession returns a Long that represents the encryption session associated with the active document.
ActiveProtectedViewWindow returns a ProtectedViewWindow object that represents the active Protected View window (the window on top). Returns Nothing if there are no Protected View windows open.
ActiveSheet returns an object that represents the active sheet (the sheet on top) in the active workbook or in the specified window or workbook. Returns Nothing if no sheet is active.
ActiveWindow returns a Window object that represents the active Excel window (the window on top). Returns Nothing if there are no windows open.
ActiveWorkbook returns a Workbook object that represents the workbook in the active window (the window on top). Returns Nothing if there are no windows open or if either the Info window or the Clipboard window is the active window.
AddIns returns an AddIns collection that represents all the add-ins listed in the Add-Ins dialog box (Add-Ins command on the Developer tab).
AddIns2 returns an AddIns2 collection that represents all the add-ins that are currently available or open in Microsoft Excel, regardless of whether they are installed.
AlertBeforeOverwriting true if Microsoft Excel displays a message before overwriting nonblank cells during a drag-and-drop editing operation.
AltStartupPath returns or sets the name of the alternate startup folder.
AlwaysUseClearType returns or sets a Boolean that represents whether to use ClearType to display fonts in the menu, ribbon, and dialog box text.
ArbitraryXMLSupportAvailable returns a Boolean value that indicates whether the XML features in Microsoft Excel are available.
AskToUpdateLinks true if Microsoft Excel asks the user to update links when opening files with links. False if links are automatically updated with no dialog box.
Assistance returns an IAssistance object for Microsoft Excel that represents the Microsoft Office Help Viewer.
AutoCorrect returns an AutoCorrect object that represents the Microsoft Excel AutoCorrect attributes.
AutoFormatAsYouTypeReplaceHyperlinks true (default) if Microsoft Excel automatically formats hyperlinks as you type. False if Excel does not automatically format hyperlinks as you type.
AutomationSecurity returns or sets an MsoAutomationSecurity constant that represents the security mode that Microsoft Excel uses when programmatically opening files.
AutoPercentEntry true if entries in cells formatted as percentages aren't automatically multiplied by 100 as soon as they are entered.
AutoRecover returns an AutoRecover object, which backs up all file formats on a timed interval.
Build returns the Microsoft Excel build number.
CalculateBeforeSave true if workbooks are calculated before they're saved to disk (if the Calculation property is set to xlManual). This property is preserved even if you change the Calculation property.
Calculation returns or sets an XlCalculation value that represents the calculation mode.
CalculationInterruptKey sets or returns an XlCalculationInterruptKey constant that specifies the key that can interrupt Microsoft Excel when performing calculations.
CalculationState returns an XlCalculationState constant that indicates the calculation state of the application, for any calculations that are being performed in Microsoft Excel.
CalculationVersion returns a number whose rightmost four digits are the minor calculation engine version number, and whose other digits (on the left) are the major version of Microsoft Excel.
Caller returns information about how Visual Basic was called (for more information, see the Remarks section).
CanPlaySounds this property should not be used. Sound notes have been removed from Microsoft Excel.
CanRecordSounds this property should not be used. Sound notes have been removed from Microsoft Excel.
Caption returns or sets a String value that represents the name that appears in the title bar of the main Microsoft Excel window.
ChartDataPointTrack true causes all charts in newly created documents to use the cell reference tracking behavior.
Charts returns a Sheets collection that represents all the chart sheets in the active workbook.
ClipboardFormats returns the formats that are currently on the Clipboard, as an array of numeric values. To determine whether a particular format is on the Clipboard, compare each element in the array with the appropriate constant listed in the Remarks section.
ClusterConnector returns or sets the name of the High Performance Computing (HPC) Cluster Connector that is used to run user-defined functions in XLL add-ins.
Columns returns a Range object that represents all the columns on the active worksheet. If the active document isn't a worksheet, the Columns property fails.
COMAddIns returns the COMAddIns collection for Microsoft Excel, which represents the currently installed COM add-ins.
CommandBars returns a CommandBars object that represents the Microsoft Excel command bars.
ConstrainNumeric true if handwriting recognition is limited to numbers and punctuation only.
ControlCharacters true if Microsoft Excel displays control characters for right-to-left languages.
CopyObjectsWithCells true if objects are cut, copied, extracted, and sorted with cells.
Cursor returns or sets the appearance of the mouse pointer in Microsoft Excel.
CursorMovement returns or sets a value that indicates whether a visual cursor or a logical cursor is used. Can be one of the following constants: xlVisualCursor or xlLogicalCursor.
CustomListCount returns the number of defined custom lists (including built-in lists).
CutCopyMode returns or sets the status of Cut or Copy mode. Can be True, False, or an XLCutCopyMode constant, as shown in the following tables.
DataEntryMode returns or sets Data Entry mode, as shown in the following table. When in Data Entry mode, you can enter data only in the unlocked cells in the currently selected range.
DecimalSeparator sets or returns the character used for the decimal separator as a String.
DefaultFilePath returns or sets the default path that Microsoft Excel uses when it opens files.
DefaultSaveFormat returns or sets the default format for saving files. For a list of valid constants, see the FileFormat property.
DefaultSheetDirection returns or sets the default direction in which Microsoft Excel displays new windows and worksheets. Can be one of the following XlReadingOrder constants: xlRTL (right to left) or xlLTR (left to right).
DefaultWebOptions returns the DefaultWebOptions object that contains global application-level attributes used by Microsoft Excel whenever you save a document as a webpage or open a webpage.
DeferAsyncQueries gets or sets whether asynchronous queries to OLAP data sources are executed when a worksheet is calculated by VBA code.
Dialogs returns a Dialogs collection that represents all built-in dialog boxes.
DisplayAlerts true if Microsoft Excel displays certain alerts and messages while a macro is running.
DisplayClipboardWindow returns True if the Microsoft Office Clipboard can be displayed.
DisplayCommentIndicator returns or sets the way cells display comments and indicators. Can be one of the XlCommentDisplayMode constants.
DisplayDocumentActionTaskPane set to True to display the Document Actions task pane; set to False to hide the Document Actions task pane.
DisplayFormulaAutoComplete gets or sets whether to show a list of relevant functions and defined names when building cell formulas.
DisplayFormulaBar true if the formula bar is displayed.
DisplayFullScreen true if Microsoft Excel is in full-screen mode.
DisplayFunctionToolTips true if function ToolTips can be displayed.
DisplayInsertOptions true if the Insert Options button should be displayed.
DisplayNoteIndicator true if cells containing notes display cell tips and contain note indicators (small dots in their upper-right corners).
DisplayPasteOptions true if the Paste Options button can be displayed.
DisplayRecentFiles true if the list of recently used files is displayed in the UI.
DisplayScrollBars true if scroll bars are visible for all workbooks.
DisplayStatusBar true if the status bar is displayed.
ErrorCheckingOptions returns an ErrorCheckingOptions object, which represents the error checking options for an application.
ExtendList true if Microsoft Excel automatically extends formatting and formulas to new data that is added to a list.
FeatureInstall returns or sets a value (constant) that specifies how Microsoft Excel handles calls to methods and properties that require features that aren't yet installed. Can be one of the MsoFeatureInstall constants listed in the following table.
FileConverters returns information about installed file converters. Returns null if there are no converters installed.
FileDialog returns a FileDialog object representing an instance of the file dialog.
FileExportConverters returns a FileExportConverters collection that represents all the file converters for saving files available to Microsoft Excel.
FileValidation returns or sets how Excel will validate files before opening them.
FileValidationPivot returns or sets how Excel will validate the contents of the data caches for PivotTable reports.
FixedDecimal all data entered after this property is set to True will be formatted with the number of fixed decimal places set by the FixedDecimalPlaces property.
FixedDecimalPlaces returns or sets the number of fixed decimal places used when the FixedDecimal property is set to True.
FlashFill true indicates that the Excel Flash Fill feature has been enabled and active.
FlashFillMode true if the Flash Fill feature is enabled.
FormulaBarHeight allows the user to specify the height of the formula bar in lines.
GenerateGetPivotData returns True when Microsoft Excel can get PivotTable report data.
GenerateTableRefs the GenerateTableRefs property determines whether the traditional notation method or the new structured referencing notation method is used for referencing tables in formulas.
Height returns or sets a Double value that represents the height, in points, of the main application window.
HighQualityModeForGraphics returns or sets whether Excel uses high quality mode to print graphics.
Hinstance returns a handle to the instance of Excel represented by the Application object.
HinstancePtr returns a handle to the instance of Excel represented by the specified Application object.
Hwnd returns a Long indicating the top-level window handle of the Microsoft Excel window.
IgnoreRemoteRequests true if remote DDE requests are ignored.
Interactive true if Microsoft Excel is in interactive mode; this property is usually True. If you set this property to False, Excel blocks all input from the keyboard and mouse (except input to dialog boxes that are displayed by your code).
International returns information about the current country/region and international settings.
IsSandboxed returns True if the specified workbook is open in a Protected View window.
Iteration true if Microsoft Excel uses iteration to resolve circular references.
LanguageSettings returns the LanguageSettings object, which contains information about the language settings in Microsoft Excel.
Left returns or sets a Double value that represents the distance, in points, from the left edge of the screen to the left edge of the main Microsoft Excel window.
LibraryPath returns the path to the Library folder, but without the final separator.
MapPaperSize true if documents formatted for the standard paper size of another country/region (for example, A4) are automatically adjusted so that they're printed correctly on the standard paper size (for example, Letter) of your country/region.
MathCoprocessorAvailable true if a math coprocessor is available.
MaxChange returns or sets the maximum amount of change between each iteration as Microsoft Excel resolves circular references.
MaxIterations returns or sets the maximum number of iterations that Microsoft Excel can use to resolve a circular reference.
MeasurementUnit specifies the measurement unit used in the application.
MergeInstances true to merge multiple instances of the application into a single instance.
MouseAvailable true if a mouse is available.
MoveAfterReturn true if the active cell is moved as soon as the Enter (Return) key is pressed.
MoveAfterReturnDirection returns or sets the direction in which the active cell is moved when the user presses Enter.
MultiThreadedCalculation returns a MultiThreadedCalculation object that controls the multi-threaded recalculation settings.
Name returns a String value that represents the name of the object.
Names returns a Names collection that represents all the names in the active workbook.
NetworkTemplatesPath returns the network path where templates are stored. If the network path doesn't exist, this property returns an empty string.
ODBCErrors returns an ODBCErrors collection that contains all the ODBC errors generated by the most recent query table or PivotTable report operation.
ODBCTimeout returns or sets the ODBC query time limit, in seconds. The default value is 45 seconds.
OLEDBErrors returns the OLEDBErrors collection, which represents the error information returned by the most recent OLE DB query.
OnWindow returns or sets the name of the procedure that's run whenever you activate a window.
OperatingSystem returns the name and version number of the current operating system.
Parent returns the parent object for the specified object.
Path returns a String value that represents the complete path to the application, excluding the final separator and name of the application.
PathSeparator returns the path separator character (\).
PivotTableSelection true if PivotTable reports use structured selection.
PreviousSelections returns an array of the last four ranges or names selected. Each element in the array is a Range range. Read-only Variant.
ProductCode returns the globally unique identifier (GUID) for Microsoft Excel.
PromptForSummaryInfo true if Microsoft Excel asks for summary information when files are first saved.
ProtectedViewWindows returns a ProtectedViewWindows collection that represents all the Protected View windows that are open in the application.
QuickAnalysis returns a QuickAnalysis object that represents the Quick Analysis options of the application.
Range returns a Range object that represents a cell or a range of cells.
Ready returns True when the Microsoft Excel application is ready; False when the Excel application is not ready.
RecentFiles returns a RecentFiles collection that represents the list of recently used files.
RecordRelative true if macros are recorded by using relative references; False if recording is absolute.
ReferenceStyle returns or sets how Microsoft Excel displays cell references and row and column headings in either A1 or R1C1 reference style.
RegisteredFunctions returns information about functions in either dynamic-link libraries (DLLs) or code resources that were registered with the REGISTER or REGISTER.ID macro functions.
RollZoom true if the IntelliMouse zooms instead of scrolling.
Rows returns a Range object that represents all the rows on the active worksheet. If the active document isn't a worksheet, the Rows property fails.
RTD returns an RTD object.
ScreenUpdating true if screen updating is turned on.
Selection returns the currently selected object on the active worksheet for an Application object. Returns Nothing if no objects are selected. Use the Select method to set the selection, and use the TypeName function to discover the kind of object that is selected.
Sheets returns a Sheets collection that represents all the sheets in the active workbook.
SheetsInNewWorkbook returns or sets the number of sheets that Microsoft Excel automatically inserts into new workbooks.
ShowChartTipNames true if charts show chart tip names. The default value is True.
ShowChartTipValues true if charts show chart tip values. The default value is True.
ShowDevTools returns or sets a Boolean that represents whether the Developer tab is displayed in the ribbon.
ShowMenuFloaties returns or sets a Boolean that represents whether to display Mini toolbars when the user right-clicks in the workbook window. False if Mini toolbars are displayed.
ShowQuickAnalysis controls whether the Quick Analysis contextual user interface is displayed on selection. True means that the Quick Analysis button will show.
ShowSelectionFloaties returns or sets a Boolean that represents whether Mini toolbars displays when a user selects text. False if Mini toolbars are displayed.
ShowStartupDialog returns True (default is False) when the New Workbook task pane appears for a Microsoft Excel application.
ShowToolTips true if ToolTips are turned on.
SmartArtColors returns the set of SmartArtColors styles that are currently loaded in the application.
SmartArtLayouts returns the set of SmartArtLayouts that are currently loaded in the application.
SmartArtQuickStyles returns the set of SmartArtQuickStyles that are currently loaded in the application.
Speech returns a Speech object.
SpellingOptions returns a SpellingOptions object that represents the spelling options of the application.
StandardFont returns or sets the name of the standard font.
StandardFontSize returns or sets the standard font size, in points.
StartupPath returns the complete path of the startup folder, excluding the final separator.
StatusBar returns or sets the text in the status bar. Read/write String.
TemplatesPath returns the local path where templates are stored.
ThisWorkbook returns a Workbook object that represents the workbook where the current macro code is running.
ThousandsSeparator sets or returns the character used for the thousands separator as a String.
Top returns or sets a Double value that represents the distance, in points, from the top edge of the screen to the top edge of the main Microsoft Excel window.
TransitionMenuKey returns or sets the Microsoft Excel menu or help key, which is usually /.
TransitionMenuKeyAction returns or sets the action taken when the Microsoft Excel menu key is pressed. Can be either xlExcelMenus or xlLotusHelp (see the Excel constants enumeration).
TransitionNavigKeys true if transition navigation keys are active.
UsableHeight returns the maximum height of the space that a window can occupy in the application window area, in points.
UsableWidth returns the maximum width of the space that a window can occupy in the application window area, in points.
UseClusterConnector returns or sets whether Excel allows user-defined functions in XLL add-ins to be run on a compute cluster.
UsedObjects returns a UsedObjects object representing objects allocated in a workbook.
UserControl true if the application is visible or if it was created or started by the user. False if you created or started the application programmatically by using the CreateObject or GetObject functions, and the application is hidden.
UserLibraryPath returns the path to the location on the user's computer where the COM add-ins are installed.
UseSystemSeparators true (default) if the system separators of Microsoft Excel are enabled.
Value returns a String value that represents the name of the application.
VBE returns a VBE object that represents the Visual Basic Editor.
Version returns a String value that represents the Microsoft Excel version number.
Visible returns or sets a Boolean value that determines whether the object is visible.
Watches returns a Watches object representing a range that is tracked when the worksheet is recalculated.
Width returns or sets a Double value that represents the distance, in points, from the left edge of the application window to its right edge.
Windows returns a Windows collection that represents all the windows in all the workbooks.
WindowsForPens true if the computer is running under Microsoft Windows for Pen Computing.
WindowState returns or sets the state of the window.
Workbooks returns a Workbooks collection that represents all the open workbooks.
WorksheetFunction returns the WorksheetFunction object.
Worksheets for an Application object, returns a Sheets collection that represents all the worksheets in the active workbook.