Skip to content

Commit 531372f

Browse files
author
sagi
committed
Sort archived guides
1 parent d2bd583 commit 531372f

12 files changed

+23
-35
lines changed

docs/archive/guides/com-server-support.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ title: "COM Server Support"
44
Functions and macros created in an Excel-DNA add-in can be called directly from Excel VBA by using Application.Run(...). However, .NET also supports creating rich object models that are exported as COM libraries, which can be Tools->Referenced in VBA. Excel-DNA has some advanced support to host COM-exported objects from Excel-DNA add-ins, giving some advantages over the regular .NET ‘Register for COM interop’ hosting approach:
55

66
- COM objects that are created via the Excel-DNA COM server support will be active in the same AppDomain as the rest of the add-in, allowing direct shared access to static variables, internal caches etc.
7+
78
- COM registration for classes hosted by Excel-DNA does not require administrative access (even when registered via RegSvr32.exe).
8-
- Everything needed for the COM server can be packed in a single-file .xll add-in, including the type library used for IntelliSense support in VBA.
9-
Mikael Katajamäki has written some detailed tutorial posts on his [Excel in Finance](http://mikejuniperhill.blogspot.com/) blog that explore this Excel-DNA feature, with detailed explanation, step-by-step instructions, screen shots and further links. See:
9+
10+
- Everything needed for the COM server can be packed in a single-file .xll add-in, including the type library used for IntelliSense support in VBA.
11+
12+
In addition to the description below, there is a sample project and a step-by-step instructions in the [Excel-DNA Samples repository](https://github.com/Excel-DNA/Samples/tree/master/DnaComServer). Note that these techniques would works equally well with code written in VB.NET, allowing you to port VB/VBA libraries to VB.NET with Excel-DNA and then use these from VBA.
13+
14+
Mikael Katajamäki has written some detailed tutorial posts on his [Excel in Finance](http://mikejuniperhill.blogspot.com/) blog that explore this Excel-DNA feature, with detailed explanation, step-by-step instructions, screen shots, and further links. Note that these project descriptions do not use the Excel-DNA Nuget packages. Therefore, the project layout is not current however, the implementation might still be instructive:
1015

1116
- [Interfacing C# and VBA with Excel-DNA (no intellisense support)](http://mikejuniperhill.blogspot.com/2014/03/interfacing-c-and-vba-with-exceldna-no.html)
12-
- [Interfacing C# and VBA with Excel-DNA (with intellisense support)](http://mikejuniperhill.blogspot.com/2014/03/interfacing-c-and-vba-with-exceldna_16.html)
1317

14-
Note that these techniques would works equally well with code written in VB.NET, allowing you to port VB/VBA libraries to VB.NET with Excel-DNA and then use these from VBA.
18+
- [Interfacing C# and VBA with Excel-DNA (with intellisense support)](http://mikejuniperhill.blogspot.com/2014/03/interfacing-c-and-vba-with-exceldna_16.html)
1519

1620
----
1721

docs/archive/guides/installing-your-add-in.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,31 @@ Ease of deployment is one of the great advantages of making your Excel add-ins u
55

66
The issue addressed here is how to install your add-in into Excel, so that it will automatically load every time Excel is started.
77

8+
## .NET Runtime
9+
10+
Excel-DNA supports add-in projects that target .NET Framework 4.x and/or .NET 6. When targeting .NET 6 the end-user must have the [.NET 6 Desktop runtime](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) installed.
11+
812
## Packing
913

10-
First, you might find it useful to try the [Excel-DNA Packing Tool](exceldna-packing-tool.md) to create a single .xll for deployment.
14+
As part of the add-in compilation, Excel-DNA creates single file packed add-ins (for 32 and 64 bit Excel) under a `publish` directory. These packed addins contain all the required dependencies and can be opened on another computer.
1115

1216
## Security
1317

1418
Note that most Excel-DNA features do not require administrator rights to run, or any registration to be dome before running the add-in. This includes the use of RTD servers as well as Ribbon and Custom Task Pane UI customization.
1519

1620
Office implements a comprehensive security system, which is accessed via the _File->Options, Trust Center_ dialog. Your Excel-DNA add-ins are subject to the security restrictions configured in the Trust Center. To operate in a secure environment I suggest you sign the packed .xll (using the signtool utility) and incorporate the certificate into the Office Trust Center, along with the macro setting to allow only digitally signed macros to be loaded.
1721

22+
As of March 2023, Microsoft is [testing an option whereby downloaded addins are blocked by default](https://insider.office.com/en-us/blog/block-untrusted-xll-add-ins-by-default). Such add-ins can be enabled according to [the instructions linked by the error message that Excel displays](https://support.microsoft.com/en-us/topic/excel-is-blocking-untrusted-xll-add-ins-by-default-1e3752e2-1177-4444-a807-7b700266a6fb).
23+
1824
## Options to just run once
1925

20-
- Run from Visual Studio. Set Project > Proprties > Debug to run Excel.exe (full path) and make .xll file the command line parameter. (And use a post build task to copy and rename the ExcelDna.xll to the bin/debug folder.)
26+
- Run from Visual Studio. Building the add-in project should set debug properties that run Excel and load the add-in ready for debugging.
2127
- Just manually File > Open the .xll file from Excel.
2228
- VBA `Application.RegisterXLL(...)` can open it. (Workbooks.Open will not work.)
2329

2430
## Options to install permanently
2531

26-
- In Excel, just File > Options > Addins. Install as an ordinary addin, not as a COM add-in even though communication may be using COM.
32+
- In Excel, just File > Options > Add-ins. Install as an ordinary addin, not as a COM add-in even though communication may be using COM.
2733
- From VBA do
2834
* Application.addins.Add `myfilename.xll`
2935
* Application.addins("myTitle").Installed = True. Title is defined by .dna file Name="myTitle", not necessarily the file name.

docs/archive/guides/reactive-extensions-for-excel.md

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,9 @@
22
title: "Reactive Extensions for Excel"
33
---
44

5-
Excel-DNA has support for integrating the [Reactive Extensions](http://msdn.microsoft.com/en-us/data/gg577609.aspx) library (Rx) with Excel via RTD.
5+
Excel-DNA has support for integrating the [Reactive Extensions](https://github.com/dotnet/reactive) library (Rx) with Excel via RTD.
66

7-
- You have to call `ExcelAsyncUtil.Initialize()` in your `AutoOpen` for any of the Rx stuff to work.
8-
9-
```csharp
10-
public class AsyncTestAddIn : IExcelAddIn
11-
{
12-
public void AutoOpen()
13-
{
14-
// This call is required for the async function and Rx support.
15-
ExcelAsyncUtil.Initialize();
16-
17-
// This is optional - allows a custom return value for Exceptions
18-
// By default exceptions just return #VALUE
19-
ExcelIntegration.RegisterUnhandledExceptionHandler(ex => "!!! EXCEPTION: " + ex.ToString());
20-
}
21-
22-
public void AutoClose()
23-
{
24-
}
25-
}
26-
```
27-
28-
29-
- I created an adapter class – called `RxExcel` but I see it is still in the `RxAdapter.cs` file - to map the .NET 4 Rx types to the Excel-DNA fake types. The idea would be that any add-in doing Rx stuff would just include the RxExcel file.
30-
31-
I need this because I still want to target .NET 2.0 with Excel-DNA, so the `System.IObservable` is not available.
7+
- To map the .NET Rx types to the Excel-DNA RTD-based mechanism, it is possible to use the following code:
328

339
```csharp
3410
using System;
File renamed without changes.
File renamed without changes.

docs/archive/guides/integrating-with-vba.md renamed to docs/archive/obsolete/integrating-with-vba.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Integrating with VBA"
33
---
4-
Excel-DNA can make it easy to call between .Net and VBA. This means existing VBA code need not be rewritten. And end users are likely to find VBA much easier to develop in.
4+
Excel-DNA can make it easy to call between .NET and VBA. This means existing VBA code need not be rewritten. And end users are likely to find VBA much easier to develop in.
55

66
To do this, create an Excel-DNA project, and register the a class that will be the entry point from VBA as follows:
77

File renamed without changes.

docs/archive/guides/performing-asynchronous-work.md renamed to docs/guides-advanced/performing-asynchronous-work.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Performing Asynchronous Work"
33
---
44
It is important to only communicate with Excel when it is Ready. For example, if one displays a non modal dialog then the program may fail if it attempts to call a VBA routine in response to a button press while the user is also in the process of editing a cell. Intercepting Window Messages messages etc. can also produce errors even though they are on the main thread. And of course accessing Excel from a different thread is forbidden.
55

6-
The best approach is to enqueue such work to execute on the main Excel thread when it is ready. Some support for initiating such cross-thread work is now (December 2012) implemented by Excel-DNA, and exposed as methods on the `ExcelDna.Integration.ExcelAsyncUtil` class.
6+
The best approach is to enqueue such work to execute on the main Excel thread when it is ready. Some support for initiating such cross-thread work is now implemented by Excel-DNA, and exposed as methods on the `ExcelDna.Integration.ExcelAsyncUtil` class.
77

88
To try it you need to
99
- call `ExcelAsyncUtil.Initialize()` in your `AutoOpen()`.

docs/archive/guides/user-settings-and-the-xllconfig-file.md renamed to docs/guides-advanced/user-settings-and-the-xllconfig-file.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
title: "User Settings and the .xll.config File"
33
---
44

5+
**NOTE:** The details below are applicable only to add-ins targeting .NET Framework 4.x. With .NET 6, the XML-based config files are no longer automatically loaded. Additionally, the `System.Configuration.ConfigurationManager` has limited backward compatibility. It is recommended to use [Microsoft.Extensions.Configuration](https://learn.microsoft.com/en-us/dotnet/core/extensions/configuration) and related libraries to use `AppSettings.json` or XML-based configuration files.
6+
57
## Basic Usage
68

79
1. Make a file called `<TheAddInName>.xll.config` with this in:

0 commit comments

Comments
 (0)