شما با این کار می تونی راحت کارتو انجام بدی
Shell "calc.exe"
البته این هم کد B2D و D2B :
Function Bin2Dec(Num As String) As Long
Dim n As Integer
n = Len(Num) - 1: a = n
Do While n > -1
x = Mid(Num, ((a + 1) - n), 1)
Bin2Dec = IIf((x = "1"), Bin2Dec + (2 ^ (n)), Bin2Dec)
n = n - 1
Loop
End Function
Public Function Dec2Bin(DecVal)
Dim bits, Dec As String
Dec = DecVal
If Dec >= 128 Then bits = "1": Dec = Dec - 128 Else bits = "0"
If Dec >= 64 Then bits = bits & "1": Dec = Dec - 64 Else bits = bits & "0"
If Dec >= 32 Then bits = bits & "1": Dec = Dec - 32 Else bits = bits & "0"
If Dec >= 16 Then bits = bits & "1": Dec = Dec - 16 Else bits = bits & "0"
If Dec >= 8 Then bits = bits & "1": Dec = Dec - 8 Else bits = bits & "0"
If Dec >= 4 Then bits = bits & "1": Dec = Dec - 4 Else bits = bits & "0"
If Dec >= 2 Then bits = bits & "1": Dec = Dec - 2 Else bits = bits & "0"
If Dec >= 1 Then bits = bits & "1": Dec = Dec - 1 Else bits = bits & "0"
If Dec > 0 Then
Dec2Bin = "11111111"
Else
Dec2Bin = bits
End If
End Function