Tải bản đầy đủ - 0 (trang)
Figure 16-2. The Excel Application object along with its hidden children

Figure 16-2. The Excel Application object along with its hidden children

Tải bản đầy đủ - 0trang

16.1 Properties and Methods of the Application Object

The Application object has a whopping 268 properties and methods, shown in Table 16-1.



_Default

_Evaluate

_FindFile

_Run2

_Wait

_WSFunction



Table 16-1. Application object members[2]

DisplayRecentFiles

OnDoubleClick

DisplayScrollBars

OnEntry

DisplayStatusBar

OnKey

DoubleClick

OnRepeat

Dummy1

OnSheetActivate

Dummy10

OnSheetDeactivate



165



ActivateMicrosoftApp

Dummy101

OnTime

ActiveCell

Dummy11

OnUndo

ActiveChart

Dummy12

OnWindow

ActiveDialog

Dummy13

OperatingSystem

ActiveMenuBar

Dummy14

OrganizationName

ActivePrinter

Dummy2

Parent

ActiveSheet

Dummy3

Path

ActiveWindow

Dummy4

PathSeparator

ActiveWorkbook

Dummy5

PivotTableSelection

AddChartAutoFormat

Dummy6

PreviousSelections

AddCustomList

Dummy7

ProductCode

AddIns

Dummy8

PromptForSummaryInfo

AlertBeforeOverwriting

Dummy9

Quit

AltStartupPath

EditDirectlyInCell

Range

AnswerWizard

EnableAnimations

Ready

Application

EnableAutoComplete

RecentFiles

AskToUpdateLinks

EnableCancelKey

RecordMacro

Assistant

EnableEvents

RecordRelative

AutoCorrect

EnableSound

ReferenceStyle

AutoFormatAsYouTypeReplaceHyperlinks EnableTipWizard

RegisteredFunctions

AutomationSecurity

ErrorCheckingOptions RegisterXLL

AutoPercentEntry

Evaluate

Repeat

AutoRecover

Excel4IntlMacroSheets

ReplaceFormat

Build

Excel4MacroSheets

ResetTipWizard

Calculate

ExecuteExcel4Macro

RollZoom

CalculateBeforeSave

ExtendList

Rows

CalculateFull

FeatureInstall

RTD

CalculateFullRebuild

FileConverters

Run

Calculation

FileDialog

Save

CalculationInterruptKey

FileFind

SaveWorkspace

CalculationState

FileSearch

ScreenUpdating

CalculationVersion

FindFile

Selection

Caller

FindFormat

SendKeys

CanPlaySounds

FixedDecimal

SetDefaultChart

CanRecordSounds

FixedDecimalPlaces

Sheets

Caption

GenerateGetPivotData SheetsInNewWorkbook

CellDragAndDrop

GetCustomListContents

ShortcutMenus

Cells

GetCustomListNum

ShowChartTipNames

CentimetersToPoints

GetOpenFilename

ShowChartTipValues

Charts

GetPhonetic

ShowStartupDialog

CheckAbort

GetSaveAsFilename

ShowToolTips

CheckSpelling

Goto

ShowWindowsInTaskbar

ClipboardFormats

Height

SmartTagRecognizers

ColorButtons

Help

Speech

Columns

Hinstance

SpellingOptions

COMAddIns

Hwnd

StandardFont



166



[2]



IgnoreRemoteRequests

InchesToPoints

InputBox

Interactive

International

Intersect

Iteration

LanguageSettings

LargeButtons

Left

LibraryPath

MacroOptions

MailLogoff

MailLogon

MailSession

MailSystem

MapPaperSize

MathCoprocessorAvailable

MaxChange

MaxIterations

MemoryFree

MemoryTotal

MemoryUsed

MenuBars

Modules

MouseAvailable

MoveAfterReturn

MoveAfterReturnDirection

Name

Names

NetworkTemplatesPath

NewWorkbook

NextLetter

ODBCErrors

ODBCTimeout

OLEDBErrors

OnCalculate

OnData



AM

FL

Y



TE



CommandBars

CommandUnderlines

ConstrainNumeric

ControlCharacters

ConvertFormula

CopyObjectsWithCells

Creator

Cursor

CursorMovement

CustomListCount

CutCopyMode

DataEntryMode

DDEAppReturnCode

DDEExecute

DDEInitiate

DDEPoke

DDERequest

DDETerminate

DecimalSeparator

DefaultFilePath

DefaultSaveFormat

DefaultSheetDirection

DefaultWebOptions

DeleteChartAutoFormat

DeleteCustomList

Dialogs

DialogSheets

DisplayAlerts

DisplayClipboardWindow

DisplayCommentIndicator

DisplayExcel4Menus

DisplayFormulaBar

DisplayFullScreen

DisplayFunctionToolTips

DisplayInfoWindow

DisplayInsertOptions

DisplayNoteIndicator

DisplayPasteOptions



StandardFontSize

StartupPath

StatusBar

TemplatesPath

ThisCell

ThisWorkbook

ThousandsSeparator

Toolbars

Top

TransitionMenuKey

TransitionMenuKeyAction

TransitionNavigKeys

UILanguage

Undo

Union

UsableHeight

UsableWidth

UsedObjects

UserControl

UserLibraryPath

UserName

UseSystemSeparators

Value

VBE

Version

Visible

Volatile

Wait

Watches

Width

Windows

WindowsForPens

WindowState

Workbooks

WorksheetFunction

Worksheets



(g) indicates a global member.



Of course, there are far too many members to discuss even the majority in a nonreference book, so

we will pick out a few of the more interesting and useful members. The important point is that you

can use Table 16-1 to find a member that suits a particular purpose and then check the Excel help

files for more information if it is not covered in this book.



167 ®

Team-Fly



We will also discuss additional properties and methods of the Application object throughout the

remainder of the book, hopefully at times when the discussion will be more relevant.

In the hope of making our discussion a bit more structured, we will try to break the members in

Table 16-1 into separate groups. Note, however, that this is in many cases a bit arbitrary.



16.1.1 Members that Return Children

Many of the members of the Application object are designed simply to gain access to a child

object of the Application object. For instance, the Workbooks property simply returns the

Workbooks collection object, which represents all of the currently open Workbook objects (i.e.,

workbooks). We will discuss many of these objects at the proper time, but it is worth taking a look

at the members that return these objects now.

Table 16-2 shows the 48 members of the Application object that return child objects.

Table 16-2. Members that return child objects

Name

ReturnType

ActiveCell

Range

ActiveChart

Chart

ActiveDialog

DialogSheet

ActiveMenuBar

MenuBar

ActiveWindow

Window

ActiveWorkbook

Workbook

AddIns

AddIns

Application

Application

AutoCorrect

AutoCorrect

AutoRecover

AutoRecover

Cells

Range

Charts

Sheets

Columns

Range

DefaultWebOptions

DefaultWebOptions

Dialogs

Dialogs

DialogSheets

Sheets

ErrorCheckingOptions

ErrorCheckingOptions

Excel4IntlMacroSheets

Sheets

Excel4MacroSheets

Sheets

FindFormat

CellFormat

Intersect

Range

MenuBars

MenuBars

Modules

Modules

Names

Names

NextLetter

Workbook

ODBCErrors

ODBCErrors

OLEDBErrors

OLEDBErrors

Parent

Application

Range

Range

RecentFiles

RecentFiles



168



ReplaceFormat

Rows

RTD

Sheets

ShortcutMenus

SmartTagRecognizers

Speech

SpellingOptions

ThisCell

ThisWorkbook

Toolbars

Union

UsedObjects

Watches

Windows

Workbooks

WorksheetFunction

Worksheets



CellFormat

Range

RTD

Sheets

Menu

SmartTagRecognizers

Speech

SpellingOptions

Range

Workbook

Toolbars

Range

UsedObjects

Watches

Windows

Workbooks

WorksheetFunction

Sheets



There are some points worth noting in Table 16-2. First, there are several members that begin with

the word "Active." It should come as no surprise that these members return the corresponding

currently active object. For instance, the ActiveSheet member returns the currently active

worksheet or chart, depending upon which is active at the time. (Note that there is no Sheet object.

Sheets are either worksheets or stand-alone charts. We will discuss this issue in detail in Chapter

18.)

Observe also that often the name of a member is the same as the name of the object that the

member returns. For instance, the AddIns property returns the AddIns collection, the Application

property returns the Application object, and the Windows property returns the Windows collection.

The notable exceptions to this rule are:





The ThisWorkBook property returns the Workbook object containing the currently

running code. One use of this property is in determining the location (complete path and

filename) of the workbook on the user's computer, which is done by writing:

ThisWorkbook.FullName







Several object properties, such as Cells, Columns, and Rows, return a Range object. This

is because there are no Cell, Column, or Row objects in the Excel object model. Instead,

each of these "objects" is actually a Range object. (Incidentally, a similar thing happens in

the Word object model. In particular, there are no Character, Word, or Sentence objects.

Rather, these are Range objects in the Word object model as well.)



16.1.2 Members that Affect the Display

There are several members that affect the display of certain items:

DisplayAlerts property (R/W Boolean)



169



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Figure 16-2. The Excel Application object along with its hidden children

Tải bản đầy đủ ngay(0 tr)

×
x