Because 671 * 64 = 42944, which is larger than the largest integer
(32767). VBA will cast the result as the largest of the two operands.
Since inv is presumably Dim'd as an integer and 64 fits into an integer,
VBA will cast the result as an integer. Hence the overflow.
There's almost never a need to use integers on modern computers (it can
actually waste processor cycles) - use long integers instead
Dim inv As Long
instead.
Alternatively, cast 64 as a long integer (&) or a double (#):
MsgBox Trim(inv * 64&)