Re: MakeArray + resize fails

62 views
Skip to first unread message

Govert van Drimmelen

unread,
Nov 18, 2012, 2:21:54 PM11/18/12
to Excel-DNA
Hi Javier,

The first-chance exception regarding ExcelDna.Loader are normal. The
occur when the runtime tries to load that assembly, and are handled
properly inside Excel-DNA by providing the required assembly from .xll
resources.

If you get a #NAME error, it means the function has not been
registered.

The code sample in the Distribution\Samples\ArrayResizer.dna is a bit
newer than the code on the website, so you might prefer that.

I suggest you first get the ArrayResizer add-in to work as a separate
add-in with just the .dna file, before incorporating into your add-in.
Remember that for 64-bit Excel you will need to add
RuntimVersion="v4.0" to the top of the .dna file.

Let me know it you get the sample to work from the .dna file, and then
if there are still problems when incorporating the code in your own
add-in.

Regards,
Govert



On Nov 18, 9:00 pm, Javier <javi.kroonenb...@gmail.com> wrote:
> Hi,
>
> I copied the code from the arrayresizer
> (http://excel-dna.net/2011/01/30/resizing-excel-udf-result-arrays/) into a
> working excelDna vs2012 solution. Postbuilds work and even the debugger is
> attached.
> Now when trying =MakeArray(2,3) i get something like #NAME....And when
> using  =MakeArray(2;3) , the result = (0,0).
>
> After debugging the thing, the first thing I noticed where the 2 Exceptions
> before arriving at the MakeArray Function.
> The Exception in this case where two times:
> "Could not load file or assembly: ExcelDna.Loader"
>
> Any thoughts?
>
> Kind regards,
> Javier

Govert van Drimmelen

unread,
Nov 18, 2012, 2:44:12 PM11/18/12
to Excel-DNA
Ah - wait....

You say "using  =MakeArray(2;3) , the result = (0,0)". This is correct
- it is the first cell in the array and everything is working right.

You need to select a 2x3 range, enter the formula and press Ctrl+Shift
+Enter to put it is an an array formula to see all the values. See
these discussions about array formulae: http://www.cpearson.com/excel/ArrayFormulas.aspx
and here: http://office.microsoft.com/en-us/excel-help/introducing-array-formulas-in-excel-HA001087290.aspx


The point of the resizer is to help with this process.
Compare how you use "=MakeArray(2;3)" with "=Resize(MakeArray(2;3))".

-Govert
Reply all
Reply to author
Forward
0 new messages