# CurrentComponentName
{: .no_toc }

Returns the name of the current component (module or class) as a literal **String**.

Syntax: **CurrentComponentName** [ **()** ]

The value identifies the source unit --- the **Module**, **Class**, **Form**, or other component --- that lexically contains the call site.

> [!NOTE]
> **CurrentComponentName** is a compile-time intrinsic: the literal string is embedded in the compiled code at the point of the call. It does not change at run time, even when the call is reached through a forwarded or inherited member.

### Example

```tb check_build
Public Sub Log(Message As String)
    Debug.Print CurrentComponentName() & ": " & Message
End Sub
```

### See Also

- [CurrentComponentCLSID](/tB/Modules/Compilation/CurrentComponentCLSID.md) function
- [CurrentProcedureName](/tB/Modules/Compilation/CurrentProcedureName.md) function
- [CurrentProjectName](/tB/Modules/Compilation/CurrentProjectName.md) function
- [CurrentSourceFile](/tB/Modules/Compilation/CurrentSourceFile.md) function
