com - Declare Function statment VBA to VB.Net and array dimensionality -
i have object wrapper of xll functions in vba object, object trying translate vb.net, com dll add-in. vba declares xll functions so:
private declare function externalfunction lib "c:\mylibrary.xll" _ (byval x double, byval y double, byval arr1d() double, _ byval arr2d() double, byval resultarray() double, byval errormssg string) _ long
of first 2 array arguments, first one-dimensional , second two-dimensional. because sending 2d array, vb.net forces me change part of declaration from:
arr2d() double
to
arr2d(,) double
should work ok in context of com? i've spent long time vetting every single input , still error object disconnected clients. missing something, i"m worried function declare , array rank, happy in vba, might not happy now.
(also, on side note, curiously, note arguments declared byval--while function change resultarray , errormessage (those real returns...). how byval declaration works in vba--which does. problem should byref, , vb.net less forgiving?)
edit: ok going vba. see in dozen or functions wrapped, have resultarray sent byref , send unqualified. visual studio stuck byval in there. problem guess. i'd still appreciate reassurance if possible vb.net form of declaring rank of array argument should ok, if could. (curiously, me, errormessage strings declared in vba byval--and work return error messages xll...)
the comma not problem. problem meaning of "long" in excel vs in vb.net. screwed question bit showing doubles , string parameter examples. focused in on thought problem , obscured real problem. long 32-bit in vba. long 64 bit in .net. function declare correct, had change longs integers, going vba vb.net, in actual declaration.
because think has eye open when or project excel dna mentioned, i'm going thank govert here. reply in thread:
https://exceldna.codeplex.com/discussions/468416
that got me answer. the...(what--funny? embarrassing?)--thing govert saved me once before on same problem, few years ago, when asked him more directly. again, , again, govert. (i didn't think go dna forum time because other people made project without it.)
Comments
Post a Comment