expressionAn expression that returns aWorkbookobject. Example This example maximizes Microsoft Excel whenever the workbook is opened. VB PrivateSubWorkbook_Open() Application.WindowState = xlMaximizedEndSub Support and feedback Have questions or feedback about Office VBA or this documentation? Please see...
This example arranges all open windows when a workbook is opened. VB PrivateSubApp_WorkbookOpen(ByValWbAsWorkbook) Application.Windows.Arrange xlArrangeStyleTiledEndSub Have questions or feedback about Office VBA or this documentation? Please seeOffice VBA support and feedbackfor guidance about the ...
表达 返回Workbook 对象的表达式。 示例 每次打开工作簿时,本示例都最大化 Microsoft Excel 窗口。 VB 复制 Private Sub Workbook_Open() Application.WindowState = xlMaximized End Sub 支持和反馈 有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南...
Workbook_Open事件在工作簿打开时触发一次。 Private Sub Workbook_Open() MsgBox "Workbook has opened!" End Sub Workbook_Activate事件在工作簿被激活(例如从其他程序切换到该工作簿或打开另一个工作簿后返回)时触发。 Private Sub Workbook_Activate() MsgBox "Workbook is activated!" End Sub 简而言之,Workbook...
表达返回Workbook对象的表达式。 示例 每次打开工作簿时,本示例都最大化 Microsoft Excel 窗口。 VB PrivateSubWorkbook_Open() Application.WindowState = xlMaximizedEndSub 支持和反馈 有关于 Office VBA 或本文档的疑问或反馈? 请参阅Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。
It is also possible to automatically execute them during a specific event of the workbook, such as the opening of the workbook, its closing, saving, etc. Workbook_Open (on opening) To execute instructions upon the opening of the workbook (after the user enables macros), go toThisWorkbookand...
表达返回Workbook对象的表达式。 示例 每次打开工作簿时,本示例都最大化 Microsoft Excel 窗口。 VB PrivateSubWorkbook_Open() Application.WindowState = xlMaximizedEndSub 支持和反馈 有关于 Office VBA 或本文档的疑问或反馈? 请参阅Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。
Occurs when the workbook is opened. C# 复制 public event Microsoft.Office.Interop.Excel.WorkbookEvents_OpenEventHandler Open; Event Type WorkbookEvents_OpenEventHandler Examples The following code example demonstrates a handler for the Open event. The event handler maximizes the Microsoft Office Excel...
Private Sub Workbook_AddinUninstall() Application.WindowState = xlMinimized End Sub AfterXmlExport 事件 在Microsoft Excel 保存或导出指定工作簿中的 XML 数据之前发生此事件。 语法 表达式.AfterXmlExport(Map, Url, Result) 表达式 一个代表 Workbook 对象的变量。 参数 说明 XlXmlExportResult 可以是下列 XlXm...
(Visual Basic Application) VBA(Visual Basic for Application)是Microsoft Office系列软件的内置编程语言,其语法结构与Visual Basic编程语言互相兼容,采用的是面向对象的编程机制和可视化的编程环境。 第一节 标识符 一.