Application 物件 (Excel)
代表整個 Microsoft Excel 應用程式。
範例
使用應用程式屬性來傳回應用程式物件。 下列範例將 Windows 屬性套用至應用程式物件。
Application.Windows("book1.xls").Activate
下列範例會在其他應用程式中建立 Excel 活頁部物件,接著在 Excel 中開啟活頁部物件。
Set xl = CreateObject("Excel.Sheet")
xl.Application.Workbooks.Open "newbook.xls"
許多傳回最常使用之使用者介面物件的屬性與方法,例如傳回作用儲存格 (ActiveCell 屬性),可以不和 Application 物件識別符號一起使用。 例如,您可以不撰寫︰
Application.ActiveCell.Font.Bold = True
您可以撰寫︰
ActiveCell.Font.Bold = True
註解
Application 物件包含:
- 整個應用程式的設定及選項
- 會傳回最上層物件的方法,例如 ActiveCell、ActiveSheet 等。
事件
- AfterCalculate
- NewWorkbook
- ProtectedViewWindowActivate
- ProtectedViewWindowBeforeClose
- ProtectedViewWindowBeforeEdit
- ProtectedViewWindowDeactivate
- ProtectedViewWindowOpen
- ProtectedViewWindowResize
- SheetActivate
- SheetBeforeDelete
- SheetBeforeDoubleClick
- SheetBeforeRightClick
- SheetCalculate
- SheetChange
- SheetDeactivate
- SheetFollowHyperlink
- SheetLensGalleryRenderComplete
- SheetPivotTableAfterValueChange
- SheetPivotTableBeforeAllocateChanges
- SheetPivotTableBeforeCommitChanges
- SheetPivotTableBeforeDiscardChanges
- SheetPivotTableUpdate
- SheetSelectionChange
- SheetTableUpdate
- WindowActivate
- WindowDeactivate
- WindowResize
- WorkbookActivate
- WorkbookAddinInstall
- WorkbookAddinUninstall
- WorkbookAfterSave
- WorkbookAfterXmlExport
- WorkbookAfterXmlImport
- WorkbookBeforeClose
- WorkbookBeforePrint
- WorkbookBeforeSave
- WorkbookBeforeXmlExport
- WorkbookBeforeXmlImport
- WorkbookDeactivate
- WorkbookModelChange
- WorkbookNewChart
- WorkbookNewSheet
- WorkbookOpen
- WorkbookPivotTableCloseConnection
- WorkbookPivotTableOpenConnection
- WorkbookRowsetComplete
- WorkbookSync
方法
- ActivateMicrosoftApp
- AddCustomList
- Calculate
- CalculateFull
- CalculateFullRebuild
- CalculateUntilAsyncQueriesDone
- CentimetersToPoints
- CheckAbort
- CheckSpelling
- ConvertFormula
- DDEExecute
- DDEInitiate
- DDEPoke
- DDERequest
- DDETerminate
- DeleteCustomList
- DisplayXMLSourcePane
- DoubleClick
- Evaluate
- ExecuteExcel4Macro
- FindFile
- GetCustomListContents
- GetCustomListNum
- GetOpenFilename
- GetPhonetic
- GetSaveAsFilename
- Goto
- Help
- InchesToPoints
- InputBox
- Intersect
- MacroOptions
- MailLogoff
- MailLogon
- NextLetter
- OnKey
- OnRepeat
- OnTime
- OnUndo
- Quit
- RecordMacro
- RegisterXLL
- Repeat
- Run
- SendKeys
- SharePointVersion
- Undo
- Union
- Volatile
- Wait
屬性
- ActiveCell
- ActiveChart
- ActiveEncryptionSession
- ActivePrinter
- ActiveProtectedViewWindow
- ActiveSheet
- ActiveWindow
- ActiveWorkbook
- AddIns
- AddIns2
- AlertBeforeOverwriting
- AltStartupPath
- AlwaysUseClearType
- Application
- ArbitraryXMLSupportAvailable
- AskToUpdateLinks
- Assistance
- AutoCorrect
- AutoFormatAsYouTypeReplaceHyperlinks
- AutomationSecurity
- AutoPercentEntry
- AutoRecover
- Build
- CalculateBeforeSave
- Calculation
- CalculationInterruptKey
- CalculationState
- CalculationVersion
- Caller
- CanPlaySounds
- CanRecordSounds
- Caption
- CellDragAndDrop
- Cells
- ChartDataPointTrack
- Charts
- ClipboardFormats
- ClusterConnector
- Columns
- COMAddIns
- CommandBars
- CommandUnderlines
- ConstrainNumeric
- ControlCharacters
- CopyObjectsWithCells
- Creator
- Cursor
- CursorMovement
- CustomListCount
- CutCopyMode
- DataEntryMode
- DDEAppReturnCode
- DecimalSeparator
- DefaultFilePath
- DefaultSaveFormat
- DefaultSheetDirection
- DefaultWebOptions
- DeferAsyncQueries
- Dialogs
- DisplayAlerts
- DisplayClipboardWindow
- DisplayCommentIndicator
- DisplayDocumentActionTaskPane
- DisplayDocumentInformationPanel
- DisplayExcel4Menus
- DisplayFormulaAutoComplete
- DisplayFormulaBar
- DisplayFullScreen
- DisplayFunctionToolTips
- DisplayInsertOptions
- DisplayNoteIndicator
- DisplayPasteOptions
- DisplayRecentFiles
- DisplayScrollBars
- DisplayStatusBar
- EditDirectlyInCell
- EnableAnimations
- EnableAutoComplete
- EnableCancelKey
- EnableCheckFileExtensions
- EnableEvents
- EnableLargeOperationAlert
- EnableLivePreview
- EnableMacroAnimations
- EnableSound
- ErrorCheckingOptions
- Excel4IntlMacroSheets
- Excel4MacroSheets
- ExtendList
- FeatureInstall
- FileConverters
- FileDialog
- FileExportConverters
- FileValidation
- FileValidationPivot
- FindFormat
- FixedDecimal
- FixedDecimalPlaces
- FlashFill
- FlashFillMode
- FormulaBarHeight
- GenerateGetPivotData
- GenerateTableRefs
- Height
- HighQualityModeForGraphics
- Hinstance
- HinstancePtr
- Hwnd
- IgnoreRemoteRequests
- Interactive
- International
- IsSandboxed
- Iteration
- LanguageSettings
- LargeOperationCellThousandCount
- Left
- LibraryPath
- MailSession
- MailSystem
- MapPaperSize
- MathCoprocessorAvailable
- MaxChange
- MaxIterations
- MeasurementUnit
- MergeInstances
- MouseAvailable
- MoveAfterReturn
- MoveAfterReturnDirection
- MultiThreadedCalculation
- Name
- Names
- NetworkTemplatesPath
- NewWorkbook
- ODBCErrors
- ODBCTimeout
- OLEDBErrors
- OnWindow
- OperatingSystem
- OrganizationName
- Parent
- Path
- PathSeparator
- PivotTableSelection
- PreviousSelections
- PrintCommunication
- ProductCode
- PromptForSummaryInfo
- ProtectedViewWindows
- QuickAnalysis
- Range
- Ready
- RecentFiles
- RecordRelative
- ReferenceStyle
- RegisteredFunctions
- ReplaceFormat
- RollZoom
- Rows
- RTD
- ScreenUpdating
- Selection
- SensitivityLabelPolicy
- Sheets
- SheetsInNewWorkbook
- ShowChartTipNames
- ShowChartTipValues
- ShowDevTools
- ShowMenuFloaties
- ShowQuickAnalysis
- ShowSelectionFloaties
- ShowStartupDialog
- ShowToolTips
- SmartArtColors
- SmartArtLayouts
- SmartArtQuickStyles
- Speech
- SpellingOptions
- StandardFont
- StandardFontSize
- StartupPath
- StatusBar
- TemplatesPath
- ThisCell
- ThisWorkbook
- ThousandsSeparator
- Top
- TransitionMenuKey
- TransitionMenuKeyAction
- TransitionNavigKeys
- UsableHeight
- UsableWidth
- UseClusterConnector
- UsedObjects
- UserControl
- UserLibraryPath
- UserName
- UseSystemSeparators
- Value
- VBE
- Version
- Visible
- WarnOnFunctionNameConflict
- Watches
- Width
- Windows
- WindowsForPens
- WindowState
- Workbooks
- WorksheetFunction
- Worksheets
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。