<p>The following code fails at runtime&hellip;</p>

<pre>
Dim Id As Guid = CType(e.CommandArgument, Guid)
</pre>

<p>It throws this exception&hellip;</p>

<pre>
System.InvalidCastException was unhandled by user code
Specified cast is not valid
</pre>

<p>Why can't I cast <strong><em>e.CommandArgument</em></strong> as a Guid?</p>

Try:
```
```
Dim DeleteId As Guid = New Guid(Convert.ToString(e.CommandArgument))
```
```
This works...
```
Dim DeleteId As Guid = New Guid(DirectCast(e.CommandArgument, String))
```