VBA and Function Pointers

For those with Clarion 11 and its new function pointer support this article might be of interest if you are working with MS Office VBA and want to do fancy things like send back row and column values via a function pointer. Although you might just clipboard the contents or XML them…

Loop through excel sheets seems a bit slow using late binding. In Csharp you get grab whole sheets as a object range.

But if your using clarion and dont want to call dot net this might be something worth exploring…

1 Like

There’s 3 or 4 pages of code and text. Can you extract some of the interesting code and paste it here, plus show some possible Clarion code?

Of interest to test is this…

lDispCallFuncResult = DispCallFunc(0, AddressOf NoParamNoReturn, _
tagCALLCONV.CC_STDCALL, VbVarType.vbEmpty, _
0, 0, 0, VarPtr(vFuncResult))

This is the address of interest.

AddressOf NoParamNoReturn

Hoping to test this as an address passed from clarion to MS Office VBA and see if we get a call back or its a silly idea…which will result in no call or its a HUNG UP…