Share via


WorksheetBase.Creator Property

Gets a value that indicates the application in which the worksheet was created.

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

Syntax

'Declaration
Public ReadOnly Property Creator As XlCreator
public XlCreator Creator { get; }

Property Value

Type: Microsoft.Office.Interop.Excel.XlCreator
If the worksheet was created in Excel, this property returns the string XCEL, which is equivalent to the hexadecimal number 5843454C.

Remarks

This property is designed to be used in Microsoft Office 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 worksheet was created in Microsoft Office Excel.

This example is for a document-level customization.

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

.NET Framework Security

See Also

Reference

WorksheetBase Class

Microsoft.Office.Tools.Excel Namespace