Modal Dialog (Form)

212 views
Skip to first unread message

S. M.

unread,
Feb 11, 2020, 8:19:05 AM2/11/20
to Excel-DNA
Hi all,

first: Thanks for the great Excel DNA package! It really helps in developing XLLs.

I have a "quick" question:

Is there a "recommend"  way (example?) on how to display a modal Form / Dialog (c#) out of Excel, basically I need to automatically populate the form field value from within Excel (Cell values), crunch some numbers and write them back into Excel and close the modal Form / Dialog. While "crunching" the numbers in C# I want to "lock" the Excel UI.

Thanks in advance.

Best regards
B

Govert van Drimmelen

unread,
Feb 11, 2020, 8:51:34 AM2/11/20
to exce...@googlegroups.com

Have a look at this project, which explores different ways for forms to interact with Excel:

https://github.com/Ron-Ldn/DotNetRefEdit

 

-Govert

--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/0e9d3598-bb35-4da4-8ca4-f9e92ddaf7b1%40googlegroups.com.

S. M.

unread,
Feb 11, 2020, 9:37:18 AM2/11/20
to Excel-DNA
Will do! Thanks!


On Tuesday, February 11, 2020 at 2:51:34 PM UTC+1, Govert van Drimmelen wrote:

Have a look at this project, which explores different ways for forms to interact with Excel:

https://github.com/Ron-Ldn/DotNetRefEdit

 

-Govert

 

 

From: exce...@googlegroups.com <exce...@googlegroups.com> On Behalf Of S. M.
Sent: 11 February 2020 15:19
To: Excel-DNA <exce...@googlegroups.com>
Subject: [ExcelDna] Modal Dialog (Form)

 

Hi all,

 

first: Thanks for the great Excel DNA package! It really helps in developing XLLs.

 

I have a "quick" question:

 

Is there a "recommend"  way (example?) on how to display a modal Form / Dialog (c#) out of Excel, basically I need to automatically populate the form field value from within Excel (Cell values), crunch some numbers and write them back into Excel and close the modal Form / Dialog. While "crunching" the numbers in C# I want to "lock" the Excel UI.

 

Thanks in advance.

 

Best regards

B

--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.

To unsubscribe from this group and stop receiving emails from it, send an email to exce...@googlegroups.com.

Bart Duijndam

unread,
Mar 14, 2021, 6:33:48 AM3/14/21
to Excel-DNA
Hi Govert,

Like the initiator of this post, I am looking for a way to create a form (launched from a ribbon) to start a dialog with the end user on input parameters, before doing calculations and providing the end result on a new sheet.
In this form I'd like to select several ranges as is done using the Excel RefEdit control (i.e. minimize the dialog & select a range) similar to what is done in the "MS Solver Add-In" dialog (available under the data ribbon).

I am aware of earlier attempts to achieve this, such as https://github.com/Ron-Ldn/DotNetRefEdit, but (unfortunately) this project hasn't led to a usable end-product. 
For instance, the form appears to be missing a message pump, as you can't edit the ranges, once selected in the form. Also, the form does not take the focus back, once a range selection has been made.

An alternative approach would be to revert back to the XLOPER approach, but that feels a bit like stepping back in the stone ages, though I am much willing to give it a go if someone has implemented this with Excel-DNA.
For instance, this topic discusses such an approach: https://groups.google.com/g/exceldna/c/U6glMmn98KU. But I don't know what the final outcome was here...

It is a pity that for easy parameter definition through a dialog box, one is still better of reverting to Visual Basic. See for instance the attached spreadsheet ("RefEdit_Alternative.xls").
Has someone been able to crack this problem leading to a 'working' example project, to be shared with the community  ?

Kind regards,

Bart

RefEdit_Alternative.xls
Reply all
Reply to author
Forward
0 new messages