Udostępnij za pośrednictwem


Workbook.Creator Property (2007 System)

Gets the application in which the workbook was created.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property Creator As XlCreator
'Usage
Dim instance As Workbook 
Dim value As XlCreator 

value = instance.Creator
[BrowsableAttribute(false)]
public XlCreator Creator { get; }
[BrowsableAttribute(false)]
public:
property XlCreator Creator {
    XlCreator get ();
}
public function get Creator () : XlCreator

Property Value

Type: XlCreator
One of the XlCreator values.

Remarks

If the object was created in Microsoft Office Excel, this property returns the string XCEL, which is equivalent to the hexadecimal number 5843454C.

This property is designed to be used in Excel for the Macintosh, where each application has a four-character creator code. For example, Excel has the creator code XCEL.

Examples

The following code example uses the Creator property to display whether the current workbook was created in Microsoft Office Excel.

This example is for a document-level customization.

Private Sub DisplayCreator()
    If Me.Creator = Excel.XlCreator.xlCreatorCode Then
        MsgBox("This workbook was created in " & _
            "Microsoft Office Excel.")
    Else
        MsgBox("This workbook was not created in " & _
            "Microsoft Office Excel.")
    End If 
End Sub
private void DisplayCreator()
{
    if (this.Creator == Excel.XlCreator.xlCreatorCode)
    {
        MessageBox.Show("This workbook was created in " +
            "Microsoft Office Excel.");
    }
    else
    {
        MessageBox.Show("This workbook was not created in " +
            "Microsoft Office Excel.");
    }
}

.NET Framework Security

See Also

Reference

Workbook Class

Workbook Members

Microsoft.Office.Tools.Excel Namespace