EXE File using ExcelDNA Add-in

270 views
Skip to first unread message

heezea

unread,
Jul 20, 2018, 11:10:04 AM7/20/18
to Excel-DNA
Hello all,

I was hoping you could help me. I'm trying to make an Excel Add-in with some special features.

I really want to use ExcelDNA since it is awesome! Especially for writing UDFs. However, I also want to create a stand-alone program (a System.Windows.Forms : Form) that handles the bulk of the interaction with the user. One of the key features is the ability to use custom hotkeys with a hook (using the CAPSLOCK button in combination with other keys). What do you think is the best way to do this?

The options I've tested/tried/considered:
1. A pure XLL file. I don't like this because I feel like it becomes cumbersome to have the UI I want.
2. A pure Windows Form file. It doesn't seem like I can effectively use the XLL with this method?
3. Maybe I should use a combination Window Form (.exe file) with an XLL file and then when I deploy the program I can use an installer to install the XLL and then the EXE can use the formulas in the XLL? If this sounds promising, any installer recommendations?

I appreciate you help!

Govert van Drimmelen

unread,
Jul 20, 2018, 3:35:23 PM7/20/18
to exce...@googlegroups.com
Hi,

Excel-DNA can help you if the code is in an Excel add-in that runs inside the Excel process.
For a standalone executable, even if it talks to Excel through the COM object model, Excel-DNA has no role to play.

You can add a user interface, show WinForms or WPF windows etc. in your Excel add-in. Some aspects or doing this can be a bit tricky regarding the threading and communicating back to Excel.
This project explores a few ways to build a user interface in your add-in that interacts with Excel, so it's a good one to experiment with a bit, and try to understand what he tried to do: https://github.com/Ron-Ldn/DotNetRefEdit

For installing your Excel-DNA based add-in, you can look at the WiX Installer template project here: https://github.com/Excel-DNA/wixinstaller


If you do want a separate application that talks to Excel through cross-process COM calls, you can still have an .xll add-in loaded in Excel (you load it through Application.RegisterXLL). Bu in that scenario there's really nothing about Excel-DNA that interacts with your external application.

-Govert



From: exce...@googlegroups.com [exce...@googlegroups.com] on behalf of heezea [hee...@gmail.com]
Sent: 20 July 2018 05:10 PM
To: Excel-DNA
Subject: [ExcelDna] EXE File using ExcelDNA Add-in

--
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 https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages