Questions tagged [excel-dna]

Excel-DNA is an independent open-source project to integrate .NET into Excel. It allows creation of Excel add-ins, including high-performance user-defined functions, using managed code.

Filter by
Sorted by
Tagged with
0 votes
2 answers
39 views

In a C# XLL (Excel add-in using ExcelDNA), how do I detect when a Workbook is closing?

I have an XLL built using ExcelDNA in C#, that contains some UDFs for calculations to use in plain XLSX workbooks. There are some actions I want the add-in to perform on the BeforeClose event in the ...
RobBaker's user avatar
  • 167
0 votes
0 answers
33 views

Is that any way to make excel only calculate partial worksheets?

I make a UDF in C# (by using Excel-DNA nuget package, version:1.7.0-rc9) to get some data from my service api and re-write the data to another worksheet, To ensure that the data is up to date and easy ...
SKYC's user avatar
  • 33
0 votes
0 answers
29 views

Excel-Dna Build is Cutting in Front of Pre-Build Event

We have a .NET 6 UDF project that has a Pre-Build event script (written in PowerShell) specified in the project's build properties. The script generates a .dna file whose content varies based on ...
Tom Baxter's user avatar
  • 2,118
0 votes
0 answers
32 views

Copy cell style to other cell with Excel-DNA and C#

I'm trying to copy a cell's style to another cell using Excel-DNA library and the copy process will be made through a button from ribbon. I defined a public class RibbonController : ExcelRibbon with: ...
Snake Eyes's user avatar
  • 16.5k
0 votes
0 answers
13 views

Why does Excel-DNA's CreateExcelAddIn function not find TlbExp.exe when SDK-style project property settings are used to create a ComServer?

I get the following error - when I use the SDK-style project property settings to configure a ComServer project. 1>MSBUILD : ExcelDnaBuild error DNA126955310: The system cannot find the file ...
user1139190's user avatar
0 votes
0 answers
12 views

Array Formula (i.e., CSE) UDFs Called Twice

We've noticed that when the user enters an array formula (the legacy CSE formulas) for a UDF, the UDF is called twice. This does not happen with dynamic arrays (Excel 365+). This "double call&...
Tom Baxter's user avatar
  • 2,118
0 votes
1 answer
34 views

Does Excel-DNA support thread-safe RTD wrapper functions?

This article is talking in the last paragraph of improvements in thread safe RTD Excel functionality in 2020: https://github.com/Excel-DNA/Tutorials/tree/master/SpecialTopics/RTD It concludes: "...
Boppity Bop's user avatar
  • 9,817
0 votes
0 answers
28 views

How to serialise access to a single device from multiple async tasks?

I have single external resource - named pipe. I need to be able to do the following: multiple async tasks can be spawn nearly simultaneously (by EXCEL-DNA function, ran in many cells) tasks will try ...
Boppity Bop's user avatar
  • 9,817
0 votes
0 answers
43 views

ExcelDNA AppDomain could not be created

When launching the .xll file for a minimal ExcelDNA add-in targeting .NET Framework 4.8, certain users see the following error: A problem occurred while the add-in was creating an isolated ...
Tim S's user avatar
  • 689
0 votes
1 answer
17 views

Not generating a <ProjectName>-Addin.dna file

I want to use open-source excel-dna.addin package But on very start, I noticed that my file -Addin.dna is not created, because Im using .net6-windows TargetFramework It works fine when Im using .net ...
lonelydev101's user avatar
  • 1,678
0 votes
1 answer
83 views

How can we utilize ExcelFunction and ExcelArgument attributes when dynamically compiling a Excel user-defined function with ExcelDNA?

I have recently worked with ExcelDNA for some sample projects to learn more about the technology. One of the features I am looking to implement is for users to create their own functions in C#, VB, ...
Tom Atwood's user avatar
0 votes
1 answer
72 views

Excel-DNA Config Settings on .NET 6

We are transitioning from using Excel-DNA on the .NET Framework to .NET 6. Under the .NET Framework, our configuration options were specified in the .xll.config file and these options were bundled ...
Tom Baxter's user avatar
  • 2,118
0 votes
0 answers
40 views

Remove Excel AddIn from the list of available addins

Is there a way to remove an addin from the list of available addins in Excel? I run into a problem because i have two addins required for my 'workflow'. I have a COM addin with some functions and a ...
Redbad's user avatar
  • 1
0 votes
1 answer
49 views

How to merge two ribbonui in excel by using c# with excel-dna package

I have two excel-addin project is wroted by C# with excel-dna package and the first add-in have a customui like follow: <?xml version="1.0" encoding="utf-8" ?> <customUI ...
SKYC's user avatar
  • 33
1 vote
0 answers
97 views

Excel DocEvent stops working following TCP messaging

I am tracking user changes to a sheet: ((Excel.DocEvents_Event)app.ActiveSheet).Change += new Excel.DocEvents_ChangeEventHandler(Event_WorksheetChange); If I change a cell's value, then my ...
chrisaycock's user avatar
  • 36.8k
0 votes
2 answers
150 views

Silent failure for callback in Excel add-in when using COM

Using Visual Studio 2022 and Excel 365... I've been able to use ExcelDna for plenty of tasks. I run into trouble when I try to use the Excel COM interface directly. To start, I define a button in the ...
chrisaycock's user avatar
  • 36.8k
2 votes
3 answers
223 views

Writing to Excel in F#

Has anyone got experience of writing values to an Excel spreadsheet from F# using Microsoft.Office.Interop? I can read values fine, but when I try to change the value of a cell I always get an error. ...
tweega's user avatar
  • 53
0 votes
0 answers
83 views

How do i convert a System.__ComObject to Microsoft.Office.Interop.Excel.Application

I have a excel add-in project and i using the Excel-DNA nuget package. I know i can convert ExcelDNAUtil.Application to Microsoft.Office.Interop.Excel.Application like: using Microsoft.Office.Interop....
SKYC's user avatar
  • 33
0 votes
0 answers
47 views

XmlSerializer formatter = new XmlSerializer(typeof(List<T>)) throws exception

I am using excel-dna to create an excel ribbon. I am saving the user settings using the xml serializer. XmlSerializer formatter = new XmlSerializer(typeof(List<Config>)); this line of code was ...
Ignore's user avatar
  • 51
0 votes
1 answer
136 views

Monitoring Excel's Edit Mode Via NativeWindow Subclassing Not Working In Excel DNA

Excel enters "Edit Mode" when a user performs one of the following actions: double clicks a cell, starts typing over it, keys F2, or clicks into the formula bar. When "Edit Mode" ...
rickmanalexander's user avatar
0 votes
0 answers
31 views

Properly disposing of OLEDB objects in .NET

I have an Excel plugin project made using ExcelDNA 1.6 in VB.NET (.NET framework 4.6.2) that uses the NetOffice 1.9.3 wrapper for Excel API calls. I'm using the "semi-annual enterprise" ...
Beastian's user avatar
0 votes
1 answer
185 views

Excel-dna Add-in opens Excel in the background after closing Excel

I wrote an Add-In using Excel-DNA. Testing it in different Excel Versions (2016,365 on different PC with Win 10) with Excel-Add-Ins getting the .xll Works fine - but when Excel is closed, a hidden ...
Red Hare's user avatar
  • 478
0 votes
1 answer
83 views

WPF Dialog Inside Excel Addin. Issues with Focus

I have an Excel add-in that I built with ExcelDNA and C#. The add-in utilizes the Essential Objects Browser within a WPF dialog. However, I'm encountering an issue when attempting to change the focus ...
EAA's user avatar
  • 45
1 vote
0 answers
166 views

Excel-DNA: Create WPF user control to be displayed after click on ribbon button

I'm coding some c# code in excel through excel-dna. I've managed to create a custom ribbon with some buttons to execute methods. However, I would like to create a WPF window/pop-up/user-control that ...
user3641311's user avatar
0 votes
0 answers
26 views

Conflicting results found in usage of IComparer being in Console App and Excel DNA

Requiring to build a UDF to be used in Excel, using Excel DNA, to present a result specially sorted in a jagged manner, using C#'s IComparer I was quite surprised as I was not getting a result ...
Faraz Ahmed Qureshi's user avatar
0 votes
0 answers
53 views

How to implement authorization for function access in Excel dna project

I work on Excel dna project under C# and .NET Core. I have severals hundreds of Excel functions. I would like to handle authorization on specific class that regoup Excel functions. For example, if a ...
elongez's user avatar
  • 21
0 votes
0 answers
125 views

Wrapping XLOPER/XLOPER12 from Excel C Api in c# (with excel-dna ?)

I have a huge XLL (more than a hundred of functions) coded (in C) using the Excel C API. I need to use several functions of this XLL in a C# code. The code of these functions is quite an intricate ...
Olórin's user avatar
  • 3,417
0 votes
2 answers
375 views

In Excel-DNA adding a new line in context menu at right-click on a cell in a spreadsheet

I would to do the following in Excel-DNA : for any workbook referencing the xll, in any sheet of the workbook, at the right click on a cell, the normal menu appears (with "cut", "copy&...
Olórin's user avatar
  • 3,417
0 votes
1 answer
276 views

Unable to write response in Excel using ExcelDNA in C#

I'm unable to write my REST API response in Excel using ExcelDNA in C#. It is working fine with reading values from specific column. xlCell[i, 1] = "TEST"; // fails with System.Runtime....
Aniket K's user avatar
0 votes
0 answers
629 views

.NET 6 Class Library with Winforms (output as DLL)

I'm trying to migrate a Class library project from .NET Framework using Excel DNA to .NET 6 - The project needs to output as a Class Library however also needs to include winforms - is there a way to ...
Jake's user avatar
  • 11
0 votes
0 answers
90 views

Get RCW's from Marshal to see which object is being held

I have an Excel add-in that needs a lot of long running references to Excel native objects. Every now and then when a user closes Excel it 'hangs' keeping an Excel process live in the background. ...
gjvdkamp's user avatar
  • 10.1k
0 votes
0 answers
120 views

Excel can't find Excel-Dna.xll after Windows update

Developed Excel-DNA project in C# using .Net6. User installed SDK and was able to run. After windows / excel update started to fail with this message. "Microsoft Excel cannot access the file xyz....
Derek Doom's user avatar
1 vote
2 answers
214 views

Publishing VSTO Office Add-In on Microsoft Store

I'm interested in finding out whether VSTO Add-Ins (or NetOffice, ExcelDNA, etc.) can be published and sold on the Microsoft Store. In the past, this was not possible - reference here. That said, ...
JDR's user avatar
  • 1,094
1 vote
0 answers
33 views

Why the DynamicMethod cant work in ExcelDna

I want to create user-defined formula in Excel addin by ExcelDna ,and before I get the api response I don't know the name of the formula.All of the formula is just like that(It's worked good): public ...
BrandonHe's user avatar
0 votes
0 answers
25 views

Registry added through c#.Net is available in registry that able to read back, but not available anywhere in regedit [duplicate]

I added a registry key value from c#.Net: using Microsoft.Win32; string REGISTRY_PATH = @"SOFTWARE\Microsoft\Office\16.0\Excel\Options"; var ...
Nirmalraja c's user avatar
0 votes
1 answer
152 views

New functions added to external DLL do not work with ExcelDNA

I am trying to work out why, having returned to my ExcelDNA project that references my separate C# DLL for communication with a remote ActivePivot, when I add new functions to the DLL they merely ...
TilleyTech's user avatar
-1 votes
1 answer
233 views

use C# Excel DNA with C# Window Form

ContextSwitchDeadlock occurred Message: Managed Debugging Assistant 'ContextSwitchDeadlock' has detected a problem in 'C:\Program Files\Microsoft Office\Office15\EXCEL.EXE'. Additional information: ...
Mohsin Ali's user avatar
3 votes
0 answers
136 views

Is it possible to obtain an untranslated (English) formula from an Excel cell using Excel's C API?

I'm writing an Excel COM add-in, using Excel-DNA to register add-in functions. Within the add-in functions I'm using the Excel-DNA wrapper for Excel's C API to get various information from worksheets, ...
Neil T's user avatar
  • 1,814
0 votes
1 answer
127 views

ExcelDna - Excel can't access function in base class

When Excel tries to call a method in a abstract base class i get a Run-Time error "Cannot run Marco 'MarcoName'. The macro may not be available" I can run code from the super class. The code ...
theHaggis's user avatar
  • 615
0 votes
1 answer
235 views

How to calculate selected Excel range using ExcelDnaUtil.Application selection?

I'm writing a custom Excel add-in that assigns specific keyboard shortcuts to tasks such as number formatting for selected cells only. When I try to add a shortcut that will recalculate the selected ...
insomniac's user avatar
  • 192
0 votes
1 answer
274 views

VBA interop with Excel-DNA

I am trying to implement Excel-DNA addin which can be called from VBA. I am following Integrating with VBA But the ExcelDna.Integration.CustomUI.ExcelComAddIn throw ExcelComAddIn is not available ...
Edward's user avatar
  • 28.8k
0 votes
1 answer
756 views

How to auto build Excel-DNA addin in VS 2019

I am trying to auto pack Excel-DNA project. I have followed Getting Started with Excel-DNA to create Excel-DNA project. I followed Excel-DNA Packing Tool to pack my project which works. I am trying to ...
Edward's user avatar
  • 28.8k
1 vote
1 answer
128 views

Single Observer created for every unique Symbol

I am working on a .NET Application which is rendering data from a source (say TCP) to excel using the Excel-DNA Library. I have given example of LtpObserver which I have created by implementing ...
cofee2code's user avatar
0 votes
0 answers
100 views

Creating Excel named ranges does not work

I'm stuck here with a seemingly simple task. I'd like to create named ranges in Excel 2019 via Excel DNA on vb.net. I searched and tried every code example I could find but cannot reproduce their ...
maymar's user avatar
  • 1
0 votes
1 answer
119 views

ExcelDNA not working when getScreentip ribbon xml attribute is set

Without putting entire ribbon xml, here is my button: <button id="getLatestCEVersion" keytip="N" label="Download Latest" screentip="Download latest version of ...
Terry's user avatar
  • 2,208
0 votes
1 answer
377 views

Excel COM Add-in installation permanently

I have an Excel COM add-in which is written with Excel DNA in xll format which should be enabled permanently. As I plan to install it to multiple machines. My attempt is to create the below registry ...
Chrissa's user avatar
  • 87
0 votes
1 answer
216 views

Custom task pane height not fully expanded empty space remains

I have problem with height of custom task pane in Excel. This task pane is created from Excel AddIn which is created using Excel-Dna library. When docked to the left side with MsoCTPDockPosition....
Daniel Dušek's user avatar
0 votes
1 answer
120 views

Detect if array function was called as legacy array (ctrl+shift+enter) or as dynamic array (enter)?

[ExcelFunction(Description = "Check if function was called as dynamic array or not")] public static bool IsDynamicArray() { //What goes in here? } I'd like to know the answer to this ...
NotAPro's user avatar
  • 135
0 votes
1 answer
115 views

Excel AddIn installed and uninstall event

I am trying to load excel xll addin in Excel VSTO. I used Globals.ThisAddIn.Application.AddIns.Add and .Installed to install and uninstall xll AddIn intelliSenseAddIn = default; ...
Edward's user avatar
  • 28.8k
1 vote
2 answers
2k views

Disable excel convert string to date while opening csv file

I am trying to disable excel to convert normail string like 1-2 to date 1/2/2021, I know there is no default settings to disable this behavior. I am wondering whether there is any event to be fired ...
Edward's user avatar
  • 28.8k

1
2 3 4 5
8