編輯

共用方式為


Workbooks Interface

Definition

A collection of all the Workbook objects that are currently open in the Microsoft Excel application.

public interface class Workbooks : System::Collections::IEnumerable
[System.Runtime.InteropServices.Guid("000208DB-0000-0000-C000-000000000046")]
public interface Workbooks : System.Collections.IEnumerable
Public Interface Workbooks
Implements IEnumerable
Attributes
Implements

Remarks

Use the Workbooks property to return the Workbooks collection.

Use the Add(Object) method to create a new, empty workbook and add it to the collection.

Use the Open(String, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) method to open a file.

For more information about using a single Workbook object, see the Workbook object.

Properties

_Default[Object]

Reserved for internal use.

Application

Returns an Application object that represents the Microsoft Excel application. Read-only.

Count

Returns the number of objects in the collection. Read-only Integer.

Creator

Returns a 32-bit integer that indicates the application in which this object was created. If the object was created in Microsoft Excel, this property returns the string XCEL, which is equivalent to the hexadecimal number 5843454C. Read-only XlCreator.

Item[Object]

Returns a single object from a collection.

Parent

Returns the parent object for the specified object. Read-only.

Methods

__OpenText(String, Object, Object, Object, XlTextQualifier, Object, Object, Object, Object, Object, Object, Object, Object, Object)

Reserved for internal use.

_Open(String, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)

Reserved for internal use.

_OpenText(String, Object, Object, Object, XlTextQualifier, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)
_OpenXML(String, Object)

Reserved for internal use.

Add(Object)

Creates a new workbook. The new workbook becomes the active workbook. Returns a Workbook object.

CanCheckOut(String)

True if Microsoft Excel can check out a specified workbook from a server. Read/write Boolean.

CheckOut(String)

Copies the specified workbook from a server to a local computer for editing.

Close()

Closes the object.

GetEnumerator()
Open(String, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)

Opens a workbook.

OpenDatabase(String, Object, Object, Object, Object)

Returns a Workbook object representing a database.

OpenText(String, Object, Object, Object, XlTextQualifier, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)

Loads and parses a text file as a new workbook with a single sheet that contains the parsed text-file data.

OpenXML(String, Object, Object)

Opens an XML data file. Returns a Workbook object.

Applies to