Resize Exception when resizing on "inactive" workbook

27 views
Skip to first unread message

dennis.p...@gmail.com

unread,
Dec 15, 2021, 9:13:46 AM12/15/21
to Excel-DNA
Hi,

I build an RTD Server which just publishes a handle, then I use another function to get the handle, retrieve teh data and resize the output.

This works quite well until I opened another workbook. If the ohter workbook is the active one, i get this error:

resizer_exception.jpg

Is this a known problem?

Kind regards,

Dennis

Govert van Drimmelen

unread,
Dec 15, 2021, 10:04:59 AM12/15/21
to Excel-DNA
Hi Dennis,

Your approach with the two functions should work well for old (pre-Dynamic Arrays) versions of Excel.

I can't recall the specific problem you describe.
I've been able to improve the ArrayResizer code over time, but not keep track of the versions so well.

I suggest you try the COM-based implementation I posted here:

If you have problems with that version, we can look further.

-Govert

dennis.p...@gmail.com

unread,
Dec 16, 2021, 4:27:38 AM12/16/21
to Excel-DNA
Hi Govert,

I tried it, no I get the excel error: ExcelDna.Integration.XlCallException in the cell of the resizing function.

Kind regards,

Dennis

Govert van Drimmelen

unread,
Dec 16, 2021, 4:50:46 AM12/16/21
to Excel-DNA
--------------------------------------------------
Excel-DNA is now registered on GitHub Sponsors.
Your monthly contribution helps the project thrive.
--------------------------------------------------

Hi Dennis,

It's important that the function calling the RTD is not in the same cell as the resizing function.
The handle must be returned to one cell, and then the resizing and array result using that handle start in a different cell.

If you've checked that, something might have gone wrong with putting in place the new resize code.
Does the MakeArrayAndResize(...) example work well at least.

Finally, there might be some other issue like an interaction with RTD.
So if you're still stuck, maybe you can try to make a small example that I can try out.

-Govert
Reply all
Reply to author
Forward
0 new messages