it's only can run by exe,how to fix run in vb6 ide?

Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As Long)

Sub Main()
Dim A As Long, B As Long, C As Long, C2 As Long
A = 3
B = 5
C = Sum(A, B)
'Modify the address of the multiplication function sum, it actually becomes the access addition function: DoAdd

MakeFunction GetFunAddr(AddressOf DoAdd), GetFunAddr(AddressOf Sum)
C2 = Sum(A, B)
MsgBox "C=" & C & ",C2=" & C2
End Sub

Function Sum(ByVal A As Long, ByVal B As Long) As Long
Sum = A * B
End Function

Function DoAdd(ByVal A As Long, ByVal B As Long) As Long
DoAdd = A + B
End Function

Public Function MakeFunction(DllFunAddr As Long, MyFunctionAddress As Long) As Boolean
'Functional use:call MyFunctionAddress= call DllFunAddr
    If DllFunAddr = 0 Then MsgBox "d_add_err": Exit Function
    Dim code(5) As Byte, JmpBackAddr As Long
    JmpBackAddr = DllFunAddr - MyFunctionAddress - 5
    code(0) = &HE9
    CopyMemory code(1), JmpBackAddr, 4
    WriteProcessMemory -1, ByVal MyFunctionAddress, ByVal VarPtr(code(0)), 5, 0
    MakeFunction = True
End Function