Is It Possible To Call Excel.GoalSeek from DNA addin?

89 views
Skip to first unread message

Terry Aney

unread,
Dec 3, 2014, 2:26:28 PM12/3/14
to exce...@googlegroups.com
Not really seeing much discussions about this.  Wondering if possible to call GoalSeek with following situations...

a) No interactive dialogs show up to user
b) I'm assuming the ExcelDNA Interop Nuget package would have to be updated to include Microsoft.Office.Tools.Excel?

Thanks in advance,
Terry

Govert van Drimmelen

unread,
Dec 3, 2014, 4:02:04 PM12/3/14
to exce...@googlegroups.com
Hi Terry,

I'd imagine you can do it by calling through the COM object model (basically the same as you would with VBA).
I think Range has a GoalSeek method.

The Microsoft.Office.Tools.Excel assembly is part of VSTO, and not compatible with Excel-DNA. But it just provides some wrappers over the COM object model, so all the functionality is available through the regular interop assemblies in the Excel-DNA.Interop package.

Please write back if you get stuck while trying this out.

Regards,
Govert


From: exce...@googlegroups.com [exce...@googlegroups.com] on behalf of Terry Aney [terry...@gmail.com]
Sent: 03 December 2014 09:26 PM
To: exce...@googlegroups.com
Subject: [ExcelDna] Is It Possible To Call Excel.GoalSeek from DNA addin?

--
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 post to this group, send email to exce...@googlegroups.com.
Visit this group at http://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.

Terry Aney

unread,
Dec 4, 2014, 2:39:56 PM12/4/14
to exce...@googlegroups.com
Thanks Govert.  It seemed to work.  They must have the HideIntellisense attribute on that method.  It wasn't showing up but it compiled and worked.  Was tricked on the intellisense.  Question about writing a vba enabled add-in.  If I expose a COMVisible method and want to pass a range, am I always going to get a 'Microsoft.Interop.Range' or one of your DNA range/reference objects?
Reply all
Reply to author
Forward
0 new messages