Application 物件 (Excel)Application object (Excel)

代表整個 Microsoft Excel 應用程式。Represents the entire Microsoft Excel application.

範例Example

使用應用程式屬性來傳回應用程式物件。Use the Application property to return the Application object. 下列範例將 Windows 屬性套用至應用程式物件。The following example applies the Windows property to the Application object.

Application.Windows("book1.xls").Activate

下列範例會在其他應用程式中建立 Excel 活頁部物件,接著在 Excel 中開啟活頁部物件。The following example creates an Excel workbook object in another application and then opens a workbook in Excel.

Set xl = CreateObject("Excel.Sheet") 
xl.Application.Workbooks.Open "newbook.xls"

許多傳回最常使用之使用者介面物件的屬性與方法,例如傳回作用儲存格 (ActiveCell 屬性),可以不和 Application 物件識別符號一起使用。Many of the properties and methods that return the most common user-interface objects, such as the active cell (ActiveCell property), can be used without the Application object qualifier. 例如,您可以不撰寫︰For example, instead of writing:

Application.ActiveCell.Font.Bold = True

您可以撰寫︰You can write:

ActiveCell.Font.Bold = True

註解Remarks

**Application** 物件包含:The **Application** object contains:
  • 整個應用程式的設定及選項Application-wide settings and options.
  • 會傳回最上層物件的方法,例如 ActiveCellActiveSheet 等。Methods that return top-level objects, such as ActiveCell, ActiveSheet, and so on.

事件Events

方法Methods

屬性Properties

另請參閱See also

支援和意見反應Support and feedback

有關於 Office VBA 或這份文件的問題或意見反應嗎?Have questions or feedback about Office VBA or this documentation? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.