How to pass an array of strings from C / C ++ dll to vba (Excel)

how to pass a string array from c / c ++ dll to vba (Excel)

dll in Visual Studio

dll is not managed, ATL, etc.

Regards Andy

+3
source share
2 answers

One way to handle this is to write your own DLL to return a Byte type SAFEARRAY as the result of the function (VB arrays are OLE SafeArrays).

To do this, you need to read the SafeArray APIs and structures. I don’t know about it myself, but the main thing you need is the SAFEARRAYBOUND structure and the SafeArrayCreate API. What the API returns to you, you return to VBA. And you are done.

+2
source

Microsoft , DLL VB5/VB6, , , VBA. Word :

Microsoft: DLL VB5 http://vb.mvps.org/tips/vb5dll.asp

. 8 ( " " ) . , .

+3

Source: https://habr.com/ru/post/1710342/


All Articles