johnywhy
07-22-2021, 02:26 PM
I want to declare a variable by directly writing the declaration directly to memory. i assume we need to create in memory:
Variable name and type info. Eg, "MyWorkbook"
I assume the variable can be created using commonly available methods such as StrPtr, VarPtr, ObjPtr, CopyMemory, etc.
Once created, then the variable could be instantiated with normal VBA (not direct memory access), using the variable-name as normal. Eg:
Set MyWorkbook = Workbooks(2)
Assume 64-bit (PtrSafe declarations etc)
Office 2016
Variable name and type info. Eg, "MyWorkbook"
I assume the variable can be created using commonly available methods such as StrPtr, VarPtr, ObjPtr, CopyMemory, etc.
Once created, then the variable could be instantiated with normal VBA (not direct memory access), using the variable-name as normal. Eg:
Set MyWorkbook = Workbooks(2)
Assume 64-bit (PtrSafe declarations etc)
Office 2016