Something to get you started, for Long:
You can learn more about VARIANT internals for example here:Uses "Console" PrintL "Assign long to variant:" Variant v v = 123 As Long PrintL "v = " + Variant#(v) PrintL PrintL "Assign another number by doing memory overlay stunt:" Long vptr = VarPtr(v)+8 Long l At vptr l = 456 PrintL "v = " + Variant#(v) PrintL PrintL "Assign another number by doing poke :" Poke(Long, vptr, 789) PrintL "v = " + Variant#(v) WaitKey
VBA Internals: Variant Variables and Pointers in Depth
Petr
Bookmarks