See my comments in the original thread re word size.

While you are waiting, here is a UDF NOT function:
Code:
Function funNot($dValue,Optional $iWordSize)

; Cast result to correct type
$funNot=CDbl(1)

; Calculate the value of all bits set
If Val($iWordSize) $iWordSize=Val($iWordSize) Else $iWordSize=16 EndIf
While $iWordSize $iWordSize=$iWordSize-1 $funNot=$funNot*2 Loop

$funNot=($funNot-1)-$dValue
EndFunction


To use:
Code:
Turn off bit: $x = $x & funNot(64)



If the size of the mask is important, supply the optional word size:
Code:
"The maximum value of an 8 bit word (byte) is: " funNot(0,8)



I've left the default word size set as 16 bits.